r53637 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53636‎ | r53637 | r53638 >
Date:04:03, 22 July 2009
Author:tstarling
Status:ok
Tags:
Comment:
(bug 19574) LocalisationCache gets confused when external code deletes its store after it does its cache freshness check. Fix by reinitialising the cache after the DB setup.
Modified paths:
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -815,6 +815,9 @@
816816
817817 # Update certain things in site_stats
818818 $db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 1, 'ss_good_articles' => 1 ) );
 819+
 820+ # Reinitialise the LocalisationCache to match the database state
 821+ Language::getLocalisationCache()->unloadAll();
819822 }
820823
821824 /**
Index: trunk/phase3/includes/LocalisationCache.php
@@ -639,6 +639,15 @@
640640 }
641641
642642 /**
 643+ * Unload all data
 644+ */
 645+ public function unloadAll() {
 646+ foreach ( $this->initialisedLangs as $lang => $unused ) {
 647+ $this->unload( $lang );
 648+ }
 649+ }
 650+
 651+ /**
643652 * Add messages to the cache, from an extension that has not yet been
644653 * migrated to $wgExtensionMessages or the LocalisationCacheRecache hook.
645654 * Called by deprecated function $wgMessageCache->addMessages().

Status & tagging log