From 8aaff6a97607f87ea217c43c48a70d45d0f271f3 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 1 Nov 2011 05:23:08 +0000 Subject: [PATCH] Bug 30934 - Warning: Invalid argument supplied for foreach() in /languages/Language.php on line 423 Doing a run of doRebuildLocalisationCache on each run of update.php --- includes/installer/DatabaseUpdater.php | 9 +++++++++ includes/installer/MysqlUpdater.php | 1 + includes/installer/OracleUpdater.php | 3 ++- includes/installer/SqliteUpdater.php | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index b21f69413a..1d2897b838 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -619,4 +619,13 @@ abstract class DatabaseUpdater { $cl->execute(); $this->output( "done.\n" ); } + + protected function doRebuildLocalisationCache() { + global $wgLocalisationCacheConf; + $wgLocalisationCacheConf['forceRecache'] = true; + $cl = $this->maintenance->runChild( 'RebuildLocalisationCache', 'rebuildLocalisationCache.php' ); + $this->output( "Rebuilding Localisation Cache... " ); + $cl->execute(); + $this->output( "done.\n" ); + } } diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 30715fdf46..ad6f7fa327 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -181,6 +181,7 @@ class MysqlUpdater extends DatabaseUpdater { array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'), + array( 'doRebuildLocalisationCache' ), // 1.19 array( 'addTable', 'config', 'patch-config.sql' ), diff --git a/includes/installer/OracleUpdater.php b/includes/installer/OracleUpdater.php index ebc15180ab..027244c69a 100644 --- a/includes/installer/OracleUpdater.php +++ b/includes/installer/OracleUpdater.php @@ -36,6 +36,7 @@ class OracleUpdater extends DatabaseUpdater { array( 'addIndex', 'user', 'i02', 'patch-user_email_index.sql' ), array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ), array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), + array( 'doRebuildLocalisationCache' ), //1.19 array( 'addTable', 'config', 'patch-config.sql' ), @@ -43,7 +44,7 @@ class OracleUpdater extends DatabaseUpdater { array( 'addTable', 'globaltemplatelinks', 'patch-globaltemplatelinks.sql' ), array( 'addTable', 'globalnamespaces', 'patch-globalnamespaces.sql' ), array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ), - + // till 2.0 i guess array( 'doRebuildDuplicateFunction' ), diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index 19e12c5f4c..2520a0f648 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -59,6 +59,7 @@ class SqliteUpdater extends DatabaseUpdater { array( 'addIndex', 'user', 'user_email', 'patch-user_email_index.sql' ), array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ), array( 'addTable', 'user_former_groups', 'patch-user_former_groups.sql'), + array( 'doRebuildLocalisationCache' ), // 1.19 array( 'addTable', 'config', 'patch-config.sql' ), -- 2.20.1