X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FrebuildLocalisationCache.php;h=db77564b36171af4bb25b11bf7258336e4d55352;hb=cf0872c783946242698bfaf9bd134d503fc393fc;hp=ffe66c6c8ebd508b60e6e70fd515ce1ebe50b3d7;hpb=3d60b479de50f5f914677c74f96434a8e139846e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index ffe66c6c8e..db77564b36 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -25,18 +25,24 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once( __DIR__ . '/Maintenance.php' ); +/** + * Maintenance script to rebuild the localisation cache. + * + * @ingroup Maintenance + */ class RebuildLocalisationCache extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = "Rebuild the localisation cache"; $this->addOption( 'force', 'Rebuild all files, even ones not out of date' ); $this->addOption( 'threads', 'Fork more than one thread', false, true ); - $this->addOption( 'outdir', 'Override the output directory (normally $wgCacheDirectory)', + $this->addOption( 'outdir', 'Override the output directory (normally $wgCacheDirectory)', false, true ); } @@ -47,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;