From: Ori Livneh Date: Fri, 6 Nov 2015 01:27:47 +0000 (-0800) Subject: LocalisationCache: try harder to use LCStoreCDB X-Git-Tag: 1.31.0-rc.0~9083 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=36171312ef0e1b9acdea876f300dca8f3ad9982e;p=lhc%2Fweb%2Fwiklou.git LocalisationCache: try harder to use LCStoreCDB When the LocalisationCache class is set to 'detect', we prefer LCStoreCDB if $wgCacheDirectory is set, but we default to LCStoreDB otherwise. Rather than give up, we should try wfTempDir(), since any directory that meets its criteria is also suitable for LCStoreCDB. Change-Id: Id3e2d2b18ddb423647bf2e893bcf942722c0e097 --- diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index fa5e288f8a..03841d6ac0 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -209,7 +209,17 @@ class LocalisationCache { $storeClass = 'LCStoreStaticArray'; break; case 'detect': - $storeClass = $wgCacheDirectory ? 'LCStoreCDB' : 'LCStoreDB'; + if ( !empty( $conf['storeDirectory'] ) ) { + $storeClass = 'LCStoreCDB'; + } else { + $cacheDir = $wgCacheDirectory ?: wfTempDir(); + if ( $cacheDir ) { + $storeConf['directory'] = $cacheDir; + $storeClass = 'LCStoreCDB'; + } else { + $storeClass = 'LCStoreDB'; + } + } break; default: throw new MWException(