X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildLocalisationCache.php;h=db77564b36171af4bb25b11bf7258336e4d55352;hb=9bdc558bc481218235b0b4f1b9c34ff6c86fd56c;hp=c48fb7421ec7bd5a41a826f7a370c5fcd8556eed;hpb=9846b1c1e9f473b79f581028dce06311530ef545;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index c48fb7421e..db77564b36 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -29,7 +29,7 @@ * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once( __DIR__ . '/Maintenance.php' ); /** * Maintenance script to rebuild the localisation cache. @@ -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;