* Store the value of the page.page_restrictions field in Title::loadFromRow() and...
[lhc/web/wiklou.git] / includes / LocalisationCache.php
index 10f5ca7..3b1f45c 100644 (file)
@@ -163,12 +163,7 @@ class LocalisationCache {
                                        $storeClass = 'LCStore_Accel';
                                        break;
                                case 'detect':
-                                       try {
-                                               $c = wfGetCache( CACHE_ACCEL );
-                                               $storeClass = 'LCStore_Accel';
-                                       } catch( Exception $c ) {
-                                               $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB';
-                                       }
+                                       $storeClass = $wgCacheDirectory ? 'LCStore_CDB' : 'LCStore_DB';
                                        break;
                                default:
                                        throw new MWException(
@@ -553,7 +548,7 @@ class LocalisationCache {
         * @param $code
         */
        public function recache( $code ) {
-               global $wgExtensionMessagesFiles, $wgExtensionAliasesFiles;
+               global $wgExtensionMessagesFiles;
                wfProfileIn( __METHOD__ );
 
                if ( !$code ) {
@@ -648,22 +643,6 @@ class LocalisationCache {
                        }
                }
 
-               # Load deprecated $wgExtensionAliasesFiles
-               foreach ( $wgExtensionAliasesFiles as $fileName ) {
-                       $data = $this->readPHPFile( $fileName, 'aliases' );
-
-                       if ( !isset( $data['aliases'] ) ) {
-                               continue;
-                       }
-
-                       $used = $this->mergeExtensionItem( $codeSequence, 'specialPageAliases',
-                               $allData['specialPageAliases'], $data['aliases'] );
-
-                       if ( $used ) {
-                               $deps[] = new FileDependency( $fileName );
-                       }
-               }
-
                # Merge core data into extension data
                foreach ( $coreData as $key => $item ) {
                        $this->mergeItem( $key, $allData[$key], $item );
@@ -671,7 +650,6 @@ class LocalisationCache {
 
                # Add cache dependencies for any referenced globals
                $deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
-               $deps['wgExtensionAliasesFiles'] = new GlobalDependency( 'wgExtensionAliasesFiles' );
                $deps['version'] = new ConstantDependency( 'MW_LC_VERSION' );
 
                # Add dependencies to the cache entry
@@ -710,31 +688,9 @@ class LocalisationCache {
                        $this->loadedItems[$code][$key] = true;
                }
 
-               # Write data to the persistant store
-               $this->saveLangInStore( $code, $data );
-
-               wfProfileOut( __METHOD__ );
-       }
-
-       /**
-        * Helper for recache() this is not mean to be called outside of recache()
-        * When the localisation store is null (LCStore_Null), method does nothing.
-        *
-        * @param $code String: language code to save data for
-        * @param $data Array: language data forged by recache()
-        */
-       protected function saveLangInStore( $code, $data ) {
-               wfProfileIn( __METHOD__ );
-
-               if( $this->store instanceof LCStore_Null ) {
-                       # No point in saving data to /dev/null
-                       wfProfileOut( __METHOD__ );
-                       return;
-               }
-
                # Save to the persistent cache
                $this->store->startWrite( $code );
-               foreach ( $data as $key => $value ) {
+               foreach ( $allData as $key => $value ) {
                        if ( in_array( $key, self::$splitKeys ) ) {
                                foreach ( $value as $subkey => $subvalue ) {
                                        $this->store->set( "$key:$subkey", $subvalue );
@@ -746,7 +702,11 @@ class LocalisationCache {
                $this->store->finishWrite();
 
                # Clear out the MessageBlobStore
-               MessageBlobStore::clear();
+               # HACK: If using a null (i.e. disabled) storage backend, we
+               # can't write to the MessageBlobStore either
+               if ( !$this->store instanceof LCStore_Null ) {
+                       MessageBlobStore::clear();
+               }
 
                wfProfileOut( __METHOD__ );
        }
@@ -860,7 +820,7 @@ interface LCStore {
 
 /**
  * LCStore implementation which uses PHP accelerator to store data.
- * This will work if one of XCache, eAccelerator, or APC cacher is configured.
+ * This will work if one of XCache, WinCache or APC cacher is configured.
  * (See ObjectCache.php)
  */
 class LCStore_Accel implements LCStore {
@@ -1204,4 +1164,4 @@ class LocalisationCache_BulkLoad extends LocalisationCache {
                        $this->unload( $code );
                }
        }
-}
+}
\ No newline at end of file