Output directory option, to allow messages to be put directly into /h/w/c
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 22 Feb 2012 02:09:05 +0000 (02:09 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 22 Feb 2012 02:09:05 +0000 (02:09 +0000)
maintenance/rebuildLocalisationCache.php

index ee3be9d..41ffa28 100644 (file)
@@ -36,6 +36,8 @@ class RebuildLocalisationCache extends Maintenance {
                $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)', 
+                       false, true );
        }
 
        public function memoryLimit() {
@@ -65,6 +67,9 @@ class RebuildLocalisationCache extends Maintenance {
                if ( $force ) {
                        $conf['forceRecache'] = true;
                }
+               if ( $this->hasOption( 'outdir' ) ) {
+                       $conf['storeDirectory'] = $this->getOption( 'outdir' );
+               }
                $lc = new LocalisationCache_BulkLoad( $conf );
 
                $codes = array_keys( Language::getLanguageNames( true ) );