Merge "phpunit: Avoid use of deprecated getMock for PHPUnit 5 compat"
[lhc/web/wiklou.git] / includes / cache / localisation / LocalisationCache.php
index 90b3de1..d499340 100644 (file)
@@ -212,23 +212,21 @@ class LocalisationCache {
                                case 'detect':
                                        if ( !empty( $conf['storeDirectory'] ) ) {
                                                $storeClass = 'LCStoreCDB';
+                                       } elseif ( $wgCacheDirectory ) {
+                                               $storeConf['directory'] = $wgCacheDirectory;
+                                               $storeClass = 'LCStoreCDB';
                                        } else {
-                                               $cacheDir = $wgCacheDirectory ?: wfTempDir();
-                                               if ( $cacheDir ) {
-                                                       $storeConf['directory'] = $cacheDir;
-                                                       $storeClass = 'LCStoreCDB';
-                                               } else {
-                                                       $storeClass = 'LCStoreDB';
-                                               }
+                                               $storeClass = 'LCStoreDB';
                                        }
                                        break;
                                default:
                                        throw new MWException(
-                                               'Please set $wgLocalisationCacheConf[\'store\'] to something sensible.' );
+                                               'Please set $wgLocalisationCacheConf[\'store\'] to something sensible.'
+                                       );
                        }
                }
 
-               wfDebugLog( 'caches', get_class( $this ) . ": using store $storeClass" );
+               wfDebugLog( 'caches', static::class . ": using store $storeClass" );
                if ( !empty( $conf['storeDirectory'] ) ) {
                        $storeConf['directory'] = $conf['storeDirectory'];
                }