r102674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102673‎ | r102674 | r102675 >
Date:19:01, 10 November 2011
Author:siebrand
Status:ok
Tags:
Comment:
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}
Modified paths:
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LocalisationCache.php
@@ -710,31 +710,9 @@
711711 $this->loadedItems[$code][$key] = true;
712712 }
713713
714 - # Write data to the persistant store
715 - $this->saveLangInStore( $code, $data );
716 -
717 - wfProfileOut( __METHOD__ );
718 - }
719 -
720 - /**
721 - * Helper for recache() this is not mean to be called outside of recache()
722 - * When the localisation store is null (LCStore_Null), method does nothing.
723 - *
724 - * @param $code String: language code to save data for
725 - * @param $data Array: language data forged by recache()
726 - */
727 - protected function saveLangInStore( $code, $data ) {
728 - wfProfileIn( __METHOD__ );
729 -
730 - if( $this->store instanceof LCStore_Null ) {
731 - # No point in saving data to /dev/null
732 - wfProfileOut( __METHOD__ );
733 - return;
734 - }
735 -
736714 # Save to the persistent cache
737715 $this->store->startWrite( $code );
738 - foreach ( $data as $key => $value ) {
 716+ foreach ( $allData as $key => $value ) {
739717 if ( in_array( $key, self::$splitKeys ) ) {
740718 foreach ( $value as $subkey => $subvalue ) {
741719 $this->store->set( "$key:$subkey", $subvalue );
@@ -746,7 +724,11 @@
747725 $this->store->finishWrite();
748726
749727 # Clear out the MessageBlobStore
750 - MessageBlobStore::clear();
 728+ # HACK: If using a null (i.e. disabled) storage backend, we
 729+ # can't write to the MessageBlobStore either
 730+ if ( !$this->store instanceof LCStore_Null ) {
 731+ MessageBlobStore::clear();
 732+ }
751733
752734 wfProfileOut( __METHOD__ );
753735 }
@@ -1204,4 +1186,4 @@
12051187 $this->unload( $code );
12061188 }
12071189 }
1208 -}
 1190+}
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102640move store writing out of recache()...hashar11:56, 10 November 2011
r102650correct variable name...hashar13:14, 10 November 2011

Status & tagging log