From: Aaron Schulz Date: Thu, 13 Aug 2009 01:39:15 +0000 (+0000) Subject: Argument cleanup X-Git-Tag: 1.31.0-rc.0~40329 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=8b65abe19bf5dcf350a4b0607b7ee9f6b0ca4f22;p=lhc%2Fweb%2Fwiklou.git Argument cleanup --- diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 4eac5764ec..7c47c08d12 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -26,7 +26,8 @@ class RebuildFileCache extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = "Build file cache for content pages"; - $this->addArgs( array( 'start', 'overwrite' ) ); + $this->addArgs( array( 'start' ) ); + $this->addOption( 'overwrite', 'Refresh page cache', false ); $this->setBatchSize( 100 ); } @@ -36,7 +37,11 @@ class RebuildFileCache extends Maintenance { $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true ); } $wgDisableCounters = false; - $start = intval( $this->getArg( 0, 0 ) ); + $start = $this->getArg( 0, 0 ); + if( !ctype_digit($start) ) { + $this->error( "Invalid value for start parameter.", true ); + } + $start = intval($start); $overwrite = $this->hasArg(1) && $this->getArg(1) === 'overwrite'; $this->output( "Building content page file cache from page {$start}!\n" );