From: Brad Jorsch Date: Thu, 10 Jan 2013 20:32:40 +0000 (-0500) Subject: Allow non-English wikis to rebuild l10n cache X-Git-Tag: 1.31.0-rc.0~21077 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=05edbe67d2f59551d74930243da1c8dfbeaf7fc1;p=lhc%2Fweb%2Fwiklou.git 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 --- 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;