Merge "Live preview: Don't show empty summary preview"
[lhc/web/wiklou.git] / includes / cache / LocalisationCache.php
index 4da379b..5b802aa 100644 (file)
@@ -204,6 +204,9 @@ class LocalisationCache {
                                case 'db':
                                        $storeClass = 'LCStoreDB';
                                        break;
+                               case 'array':
+                                       $storeClass = 'LCStoreStaticArray';
+                                       break;
                                case 'detect':
                                        $storeClass = $wgCacheDirectory ? 'LCStoreCDB' : 'LCStoreDB';
                                        break;
@@ -506,15 +509,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 );
@@ -559,7 +562,6 @@ class LocalisationCache {
                        }
                }
 
-
                // The JSON format only supports messages, none of the other variables, so wrap the data
                return array( 'messages' => $data );
        }
@@ -705,7 +707,6 @@ class LocalisationCache {
                $deps['plurals'] = new FileDependency( "$IP/languages/data/plurals.xml" );
                $deps['plurals-mw'] = new FileDependency( "$IP/languages/data/plurals-mediawiki.xml" );
 
-
                return $data;
        }
 
@@ -855,7 +856,6 @@ class LocalisationCache {
                $codeSequence = array_merge( array( $code ), $coreData['fallbackSequence'] );
                $messageDirs = $this->getMessagesDirs();
 
-
                # Load non-JSON localisation data for extensions
                $extensionData = array_combine(
                        $codeSequence,
@@ -952,7 +952,6 @@ class LocalisationCache {
                        }
                }
 
-
                # Add cache dependencies for any referenced globals
                $deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
                // $wgMessagesDirs is used in LocalisationCache::getMessagesDirs()
@@ -1024,7 +1023,8 @@ class LocalisationCache {
                # HACK: If using a null (i.e. disabled) storage backend, we
                # can't write to the MessageBlobStore either
                if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) {
-                       MessageBlobStore::getInstance()->clear();
+                       $blobStore = new MessageBlobStore();
+                       $blobStore->clear();
                }
 
        }