X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildLocalisationCache.php;h=4213d5f85d9f97405ea74b7dcfb7348f6d406dea;hb=853838a322610efa01db0917b76e0aeac65e68ba;hp=8a519e7178f8b449e07a41a96ce93491cd753f44;hpb=04f1fc65fd7b915fe77d56c7cf4dddf767370498;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 8a519e7178..4213d5f85d 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -29,10 +29,6 @@ * @ingroup Maintenance */ -use MediaWiki\Config\ServiceOptions; -use MediaWiki\Logger\LoggerFactory; -use MediaWiki\MediaWikiServices; - require_once __DIR__ . '/Maintenance.php'; /** @@ -62,7 +58,7 @@ class RebuildLocalisationCache extends Maintenance { } public function execute() { - global $wgLocalisationCacheConf, $wgCacheDirectory; + global $wgLocalisationCacheConf; $force = $this->hasOption( 'force' ); $threads = $this->getOption( 'threads', 1 ); @@ -81,25 +77,13 @@ class RebuildLocalisationCache extends Maintenance { $conf = $wgLocalisationCacheConf; $conf['manualRecache'] = false; // Allow fallbacks to create CDB files - $conf['forceRecache'] = $force || !empty( $conf['forceRecache'] ); + if ( $force ) { + $conf['forceRecache'] = true; + } if ( $this->hasOption( 'outdir' ) ) { $conf['storeDirectory'] = $this->getOption( 'outdir' ); } - // XXX Copy-pasted from ServiceWiring.php. Do we need a factory for this one caller? - $lc = new LocalisationCacheBulkLoad( - new ServiceOptions( - LocalisationCache::$constructorOptions, - $conf, - MediaWikiServices::getInstance()->getMainConfig() - ), - LocalisationCache::getStoreFromConf( $conf, $wgCacheDirectory ), - LoggerFactory::getInstance( 'localisation' ), - [ function () { - MediaWikiServices::getInstance()->getResourceLoader() - ->getMessageBlobStore()->clear(); - } ], - MediaWikiServices::getInstance()->getLanguageNameUtils() - ); + $lc = new LocalisationCacheBulkLoad( $conf ); $allCodes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) ); if ( $this->hasOption( 'lang' ) ) {