X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=maintenance%2FupdateCollation.php;h=9bcba7e34400b6fb4ccb5fb43429313f6ea97ba5;hb=e2c20de40d1f863eb756dc3af7c74421ad73ccbb;hp=ab40e4863ecbf2981d6497dc86a044d63df0f348;hpb=ffb2ab7f54ab3d1316ef56d1f59b5a386fd06be8;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 ) {