Quick hack workaround for lack of optional argument lists in Maintenance class:
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 18 Aug 2009 22:03:57 +0000 (22:03 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 18 Aug 2009 22:03:57 +0000 (22:03 +0000)
* 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

maintenance/rebuildFileCache.php

index f069b2f..0173726 100644 (file)
@@ -26,7 +26,7 @@ class RebuildFileCache extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Build file cache for content pages";
-               $this->addArgs( array( 'start' ) );
+               //$this->addArgs( array( 'start' ) );
                $this->addOption( 'overwrite', 'Refresh page cache', false );
                $this->setBatchSize( 100 );
        }
@@ -38,7 +38,7 @@ class RebuildFileCache extends Maintenance {
                        $this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true );
                }
                $wgDisableCounters = false;
-               $start = $this->getArg( 0, 0 );
+               $start = $this->getArg( 0, "0" );
                if( !ctype_digit($start) ) {
                        $this->error( "Invalid value for start parameter.", true );
                }