add --help --only=Apage
authorAntoine Musso <hashar@users.mediawiki.org>
Sun, 10 Jul 2005 18:23:06 +0000 (18:23 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Sun, 10 Jul 2005 18:23:06 +0000 (18:23 +0000)
maintenance/updateSpecialPages.php

index 5b30fa5..3605362 100644 (file)
@@ -1,12 +1,20 @@
 <?php
 
 # Run this script periodically if you have miser mode enabled, to refresh the caches
+$options = array('only','help');
 
 require_once( 'commandLine.inc' );
 
 require_once( 'SpecialPage.php' );
 require_once( 'QueryPage.php' );
 
+if($options['help']) {
+       print "usage:updateSpecialPages.php [--help] [--only=page]\n";
+       print "  --help      : this help message\n";
+       print "  --only=page : only update 'page'. Ex: --only=BrokenRedirects\n";
+       die();
+}
+
 $wgOut->disable();
 $dbw =& wfGetDB( DB_MASTER );
 
@@ -24,6 +32,7 @@ foreach ( $wgQueryPages as $page ) {
        }
        $queryPage = new $class;
 
+       if( !(isset($options['only'])) or ($options['only'] == $queryPage->getName()) ) {
        printf( '%-30s',  $special );
 
        if ( $queryPage->isExpensive() ) {
@@ -74,6 +83,7 @@ foreach ( $wgQueryPages as $page ) {
        } else {
                print "cheap, skipped\n";
        }
+       }
 }
 
 ?>