(bug 19574) LocalisationCache gets confused when external code deletes its store...
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 22 Jul 2009 04:03:46 +0000 (04:03 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 22 Jul 2009 04:03:46 +0000 (04:03 +0000)
includes/LocalisationCache.php
maintenance/parserTests.inc

index 6195d73..77fa7cb 100644 (file)
@@ -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. 
index 46acbde..a5e9b27 100644 (file)
@@ -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();
        }
 
        /**