Services: Convert LocalisationCache's static to a const now HHVM is gone
[lhc/web/wiklou.git] / maintenance / rebuildLocalisationCache.php
index a239fa0..07c5569 100644 (file)
@@ -62,7 +62,7 @@ class RebuildLocalisationCache extends Maintenance {
        }
 
        public function execute() {
-               global $wgLocalisationCacheConf;
+               global $wgLocalisationCacheConf, $wgCacheDirectory;
 
                $force = $this->hasOption( 'force' );
                $threads = $this->getOption( 'threads', 1 );
@@ -88,17 +88,16 @@ class RebuildLocalisationCache extends Maintenance {
                // XXX Copy-pasted from ServiceWiring.php. Do we need a factory for this one caller?
                $lc = new LocalisationCacheBulkLoad(
                        new ServiceOptions(
-                               LocalisationCache::$constructorOptions,
+                               LocalisationCache::CONSTRUCTOR_OPTIONS,
                                $conf,
                                MediaWikiServices::getInstance()->getMainConfig()
                        ),
-                       new LCStoreDB( [] ),
+                       LocalisationCache::getStoreFromConf( $conf, $wgCacheDirectory ),
                        LoggerFactory::getInstance( 'localisation' ),
                        [ function () {
                                MediaWikiServices::getInstance()->getResourceLoader()
                                        ->getMessageBlobStore()->clear();
-                       } ],
-                       MediaWikiServices::getInstance()->getLanguageNameUtils()
+                       } ]
                );
 
                $allCodes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );