X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fcache%2FLocalisationCache.php;h=f5b235055ed56cda359de941c92ae2afe15b253d;hb=415b31766677e190c13322742b4e42da1157538c;hp=dc5a2eb6bca1eb9d2be6808597c8a719c119467e;hpb=3bdc9d715f696c1aee226e3993466adde14cdead;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index dc5a2eb6bc..f5b235055e 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -23,6 +23,7 @@ use Cdb\Exception as CdbException; use Cdb\Reader as CdbReader; use Cdb\Writer as CdbWriter; +use CLDRPluralRuleParser\Evaluator; /** * Class for caching the contents of localisation files, Messages*.php @@ -204,6 +205,9 @@ class LocalisationCache { case 'db': $storeClass = 'LCStoreDB'; break; + case 'array': + $storeClass = 'LCStoreStaticArray'; + break; case 'detect': $storeClass = $wgCacheDirectory ? 'LCStoreCDB' : 'LCStoreDB'; break; @@ -506,15 +510,15 @@ class LocalisationCache { */ protected function readPHPFile( $_fileName, $_fileType ) { // Disable APC caching - wfSuppressWarnings(); + MediaWiki\suppressWarnings(); $_apcEnabled = ini_set( 'apc.cache_by_default', '0' ); - wfRestoreWarnings(); + MediaWiki\restoreWarnings(); include $_fileName; - wfSuppressWarnings(); + MediaWiki\suppressWarnings(); ini_set( 'apc.cache_by_default', $_apcEnabled ); - wfRestoreWarnings(); + MediaWiki\restoreWarnings(); if ( $_fileType == 'core' || $_fileType == 'extension' ) { $data = compact( self::$allKeys ); @@ -536,13 +540,11 @@ class LocalisationCache { public function readJSONFile( $fileName ) { if ( !is_readable( $fileName ) ) { - return array(); } $json = file_get_contents( $fileName ); if ( $json === false ) { - return array(); } @@ -575,7 +577,7 @@ class LocalisationCache { return null; } try { - $compiledRules = CLDRPluralRuleEvaluator::compile( $rules ); + $compiledRules = Evaluator::compile( $rules ); } catch ( CLDRPluralRuleError $e ) { wfDebugLog( 'l10n', $e->getMessage() );