From: Tim Starling Date: Wed, 22 Jul 2009 04:03:46 +0000 (+0000) Subject: (bug 19574) LocalisationCache gets confused when external code deletes its store... X-Git-Tag: 1.31.0-rc.0~40773 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=b6640b29e96cd242ddfb6ac81cd2eb93cafb5413;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/includes/LocalisationCache.php b/includes/LocalisationCache.php index 6195d735fb..77fa7cb587 100644 --- a/includes/LocalisationCache.php +++ b/includes/LocalisationCache.php @@ -638,6 +638,15 @@ class LocalisationCache { } } + /** + * Unload all data + */ + public function unloadAll() { + foreach ( $this->initialisedLangs as $lang => $unused ) { + $this->unload( $lang ); + } + } + /** * Add messages to the cache, from an extension that has not yet been * migrated to $wgExtensionMessages or the LocalisationCacheRecache hook. diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 46acbdea5e..a5e9b27480 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -815,6 +815,9 @@ class ParserTest { # Update certain things in site_stats $db->insert( 'site_stats', array( 'ss_row_id' => 1, 'ss_images' => 1, 'ss_good_articles' => 1 ) ); + + # Reinitialise the LocalisationCache to match the database state + Language::getLocalisationCache()->unloadAll(); } /**