Use FileBaseSiteLookup if $wgSitesCacheFile is set.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 20 Dec 2016 20:14:41 +0000 (21:14 +0100)
committerLegoktm <legoktm@member.fsf.org>
Tue, 20 Dec 2016 20:53:32 +0000 (20:53 +0000)
Change-Id: I150011d6d2f596fb4edb9b52ed09ef2951ce6d1e

includes/ServiceWiring.php

index 4fec472..ce82702 100644 (file)
@@ -71,8 +71,14 @@ return [
        },
 
        'SiteLookup' => function( MediaWikiServices $services ) {
-               // Use the default SiteStore as the SiteLookup implementation for now
-               return $services->getSiteStore();
+               $cacheFile = $services->getMainConfig()->get( 'SitesCacheFile' );
+
+               if ( $cacheFile !== false ) {
+                       return new FileBasedSiteLookup( $cacheFile );
+               } else {
+                       // Use the default SiteStore as the SiteLookup implementation for now
+                       return $services->getSiteStore();
+               }
        },
 
        'ConfigFactory' => function( MediaWikiServices $services ) {