From b6640b29e96cd242ddfb6ac81cd2eb93cafb5413 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 22 Jul 2009 04:03:46 +0000 Subject: [PATCH] (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. --- includes/LocalisationCache.php | 9 +++++++++ maintenance/parserTests.inc | 3 +++ 2 files changed, 12 insertions(+) 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(); } /** -- 2.20.1