Correctly register storeDirectory in l10n cache
authorAryeh Gregor <ayg@aryeh.name>
Mon, 26 Aug 2019 09:41:56 +0000 (12:41 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Mon, 26 Aug 2019 09:41:56 +0000 (12:41 +0300)
e4468a1d6b6 made LocalisationCache a service and refactored a bunch of
setup code. In doing so, when processing 'storeDirectory' from
$wgLocalisationCacheConf, it accidentally started treating empty
non-null values (such as the default "false") as storage paths instead
of meaning "fall back to $wgCacheDirectory". This would have broken all
config that used file store for LocalisationCache and did not specify
'storeDirectory'.

Bug: T231183
Change-Id: I9ff16be628996b202599e3bb2feed088af03775f

includes/ServiceWiring.php

index 21a66cd..9daf70d 100644 (file)
@@ -298,7 +298,7 @@ return [
                // Figure out what class to use for the LCStore
                $storeArg = [];
                $storeArg['directory'] =
-                       $conf['storeDirectory'] ?? $services->getMainConfig()->get( 'CacheDirectory' );
+                       $conf['storeDirectory'] ?: $services->getMainConfig()->get( 'CacheDirectory' );
 
                if ( !empty( $conf['storeClass'] ) ) {
                        $storeClass = $conf['storeClass'];