X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2FrebuildLocalisationCache.php;h=83849de65b03a154d3a231e0cad1acad3ba02535;hb=289c4079577a676bff59a91d5b6e5bccc7d487d3;hp=ee3be9d16e547a284e050e44fd0de750659ec80f;hpb=f3f180850a7f16297c8558ab73521843f1a1a628;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index ee3be9d16e..83849de65b 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -25,21 +25,32 @@ * 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)', + false, true ); } public function memoryLimit() { - return '200M'; + if ( $this->hasOption( 'memory-limit' ) ) { + return parent::memoryLimit(); + } + return '1000M'; } public function execute() { @@ -65,9 +76,12 @@ 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 ) ); + $codes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) ); sort( $codes ); // Initialise and split into chunks