X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateCollation.php;h=9bcba7e34400b6fb4ccb5fb43429313f6ea97ba5;hb=e390198c4e4be7632b01173e42050061f1cc346a;hp=ab40e4863ecbf2981d6497dc86a044d63df0f348;hpb=9c820c92220ad94fae45169490aa0e6301e4d36c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index ab40e4863e..9bcba7e344 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -26,6 +26,7 @@ require_once __DIR__ . '/Maintenance.php'; +use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\IDatabase; /** @@ -43,10 +44,10 @@ class UpdateCollation extends Maintenance { public function __construct() { parent::__construct(); - global $wgCategoryCollation; + $categoryCollation = $this->getConfig()->get( 'CategoryCollation' ); $this->addDescription( <<getDB( DB_MASTER ); $dbr = $this->getDB( DB_REPLICA ); $force = $this->getOption( 'force' ); @@ -80,7 +79,7 @@ TEXT $collationName = $this->getOption( 'target-collation' ); $collation = Collation::factory( $collationName ); } else { - $collationName = $wgCategoryCollation; + $collationName = $this->getConfig()->get( 'CategoryCollation' ); $collation = Collation::singleton(); } @@ -103,9 +102,8 @@ TEXT 'STRAIGHT_JOIN' // per T58041 ]; - if ( $force ) { - $collationConds = []; - } else { + $collationConds = []; + if ( !$force ) { if ( $this->hasOption( 'previous-collation' ) ) { $collationConds['cl_collation'] = $this->getOption( 'previous-collation' ); } else { @@ -186,7 +184,8 @@ TEXT } # cl_type will be wrong for lots of pages if cl_collation is 0, # so let's update it while we're here. - $type = MWNamespace::getCategoryLinkType( $title->getNamespace() ); + $type = MediaWikiServices::getInstance()->getNamespaceInfo()-> + getCategoryLinkType( $title->getNamespace() ); $newSortKey = $collation->getSortKey( $title->getCategorySortkey( $prefix ) ); if ( $verboseStats ) {