mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-27 09:43:06 +00:00
Avoid usage of deprecated $wgContLang global (dep in 1.32)
Change-Id: Ic70ac2bc7eeba6af9a69bb1eb839a87cd06c01f8
This commit is contained in:
parent
3c6ddb6ac4
commit
5b342c51ab
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgContLang" />
|
||||
</rule>
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php,php5,inc" />
|
||||
|
|
|
@ -80,14 +80,14 @@ class ApiCategoryTree extends ApiBase {
|
|||
* @return string HTML
|
||||
*/
|
||||
private function getHTML( CategoryTree $ct, Title $title, $depth, Config $ctConfig ) {
|
||||
global $wgContLang, $wgMemc;
|
||||
global $wgMemc;
|
||||
|
||||
$mckey = ObjectCache::getLocalClusterInstance()->makeKey(
|
||||
'ajax-categorytree',
|
||||
md5( $title->getDBkey() ),
|
||||
md5( $ct->getOptionsAsCacheKey( $depth ) ),
|
||||
$this->getLanguage()->getCode(),
|
||||
$wgContLang->getExtraHashOptions(),
|
||||
MediaWikiServices::getInstance()->getContentLanguage()->getExtraHashOptions(),
|
||||
$ctConfig->get( 'RenderHashAppend' )
|
||||
);
|
||||
|
||||
|
|
|
@ -94,8 +94,6 @@ class CategoryTree {
|
|||
* @return array|bool
|
||||
*/
|
||||
private static function decodeNamespaces( $nn ) {
|
||||
global $wgContLang;
|
||||
|
||||
if ( $nn === false || is_null( $nn ) ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -105,7 +103,7 @@ class CategoryTree {
|
|||
}
|
||||
|
||||
$namespaces = [];
|
||||
|
||||
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
|
||||
foreach ( $nn as $n ) {
|
||||
if ( is_int( $n ) ) {
|
||||
$ns = $n;
|
||||
|
@ -122,7 +120,7 @@ class CategoryTree {
|
|||
} elseif ( $n == '-' || $n == '_' || $n == '*' || $lower == 'main' ) {
|
||||
$ns = NS_MAIN;
|
||||
} else {
|
||||
$ns = $wgContLang->getNsIndex( $n );
|
||||
$ns = $contLang->getNsIndex( $n );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -697,8 +695,6 @@ class CategoryTree {
|
|||
public static function createCountString( IContextSource $context, Category $cat = null,
|
||||
$countMode
|
||||
) {
|
||||
global $wgContLang;
|
||||
|
||||
# Get counts, with conversion to integer so === works
|
||||
# Note: $allCount is the total number of cat members,
|
||||
# not the count of how many members are normal pages.
|
||||
|
@ -713,8 +709,8 @@ class CategoryTree {
|
|||
# numbers and commas get messed up in a mixed dir env
|
||||
'dir' => $context->getLanguage()->getDir()
|
||||
];
|
||||
|
||||
$s = $wgContLang->getDirMark() . ' ';
|
||||
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
|
||||
$s = $contLang->getDirMark() . ' ';
|
||||
|
||||
# Create a list of category members with only non-zero member counts
|
||||
$memberNums = [];
|
||||
|
|
Loading…
Reference in a new issue