From 05edbe67d2f59551d74930243da1c8dfbeaf7fc1 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 10 Jan 2013 15:32:40 -0500 Subject: [PATCH] Allow non-English wikis to rebuild l10n cache If a wiki is configured to use the l10n cache and $wgLanguageCode is set to anything other that 'en', all maintenance scripts will fail until the l10n cache is build for the first time. This includes maintenance/rebuildLocalisationCache.php, the maintenance script that builds the l10n cache. To break this dependency, have maintenance/rebuildLocalisationCache.php force $wgLanguageCode = 'en'. Change-Id: Ia93998b0f85fd122dd7b01eeeef698f595360945 --- maintenance/rebuildLocalisationCache.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 83849de65b..db77564b36 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -53,6 +53,15 @@ class RebuildLocalisationCache extends Maintenance { return '1000M'; } + public function finalSetup() { + # This script needs to be run to build the inital l10n cache. But if + # $wgLanguageCode is not 'en', it won't be able to run because there is + # no l10n cache. Break the cycle by forcing $wgLanguageCode = 'en'. + global $wgLanguageCode; + $wgLanguageCode = 'en'; + return parent::finalSetup(); + } + public function execute() { global $wgLocalisationCacheConf; -- 2.20.1