r55279 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55278‎ | r55279 | r55280 >
Date:22:03, 18 August 2009
Author:brion
Status:ok
Tags:
Comment:
Quick hack workaround for lack of optional argument lists in Maintenance class:
* don't list the start argument (good: means we default to 0; bad: means the --help doesn't list it)
* use "0" rather than 0 as the default so it doesn't fail the ctype_digit check
Modified paths:
  • /trunk/phase3/maintenance/rebuildFileCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/rebuildFileCache.php
@@ -26,7 +26,7 @@
2727 public function __construct() {
2828 parent::__construct();
2929 $this->mDescription = "Build file cache for content pages";
30 - $this->addArgs( array( 'start' ) );
 30+ //$this->addArgs( array( 'start' ) );
3131 $this->addOption( 'overwrite', 'Refresh page cache', false );
3232 $this->setBatchSize( 100 );
3333 }
@@ -38,7 +38,7 @@
3939 $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true );
4040 }
4141 $wgDisableCounters = false;
42 - $start = $this->getArg( 0, 0 );
 42+ $start = $this->getArg( 0, "0" );
4343 if( !ctype_digit($start) ) {
4444 $this->error( "Invalid value for start parameter.", true );
4545 }

Status & tagging log