From 490bc418cfded71995924490020d3dac5a6a4fee Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Thu, 10 Nov 2011 19:01:41 +0000 Subject: [PATCH] Revert r102650, r102640. Caused breakage on translatewiki.net: No localisation cache found for English. Please run maintenance/rebuildLocalisationCache.php. Backtrace: #0 /www/w/includes/LocalisationCache.php(288): LocalisationCache->initLanguage('en') #1 /www/w/includes/LocalisationCache.php(223): LocalisationCache->loadItem('en', 'specialPageAlia...') #2 /www/w/languages/Language.php(2630): LocalisationCache->getItem('en', 'specialPageAlia...') #3 /www/w/includes/SpecialPageFactory.php(211): Language->getSpecialPageAliases() #4 /www/w/includes/SpecialPageFactory.php(247): SpecialPageFactory::getAliasList() #5 /www/w/includes/Title.php(4186): SpecialPageFactory::resolveAlias('LanguageStats/n...') #6 /www/w/includes/Wiki.php(154): Title->isSpecial('Badtitle') #7 /www/w/includes/Wiki.php(605): MediaWiki->performRequest() #8 /www/w/includes/Wiki.php(524): MediaWiki->main() #9 /www/w/index.php(58): MediaWiki->run() #10 {main} --- includes/LocalisationCache.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/includes/LocalisationCache.php b/includes/LocalisationCache.php index 10f5ca7f12..ad707dc18a 100644 --- a/includes/LocalisationCache.php +++ b/includes/LocalisationCache.php @@ -710,31 +710,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 +724,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__ ); } @@ -1204,4 +1186,4 @@ class LocalisationCache_BulkLoad extends LocalisationCache { $this->unload( $code ); } } -} +} \ No newline at end of file -- 2.20.1