Make LocalisationCache a service
[lhc/web/wiklou.git] / maintenance / rebuildLocalisationCache.php
index a239fa0..1f4ac85 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 );
@@ -92,13 +92,12 @@ class RebuildLocalisationCache extends Maintenance {
                                $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' ) );