r39984 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39983‎ | r39984 | r39985 >
Date:23:25, 25 August 2008
Author:aaron
Status:old
Tags:
Comment:
Add parameters
Modified paths:
  • /trunk/extensions/FlaggedRevs/maintenance/updateLinks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.php
@@ -5,13 +5,37 @@
66 } else {
77 $IP = dirname(__FILE__).'/../../..';
88 }
 9+
 10+$options = array( 'updateonly', 'help', 'start' );
911 require "$IP/maintenance/commandLine.inc";
1012 require dirname(__FILE__) . '/updateLinks.inc';
1113
 14+if( isset($options['help']) ) {
 15+ echo <<<TEXT
 16+Usage:
 17+ php updateLinks.php --help
 18+ php updateLinks.php [--start <ID> | --updateonly <CALL> ]
 19+
 20+ --help : This help message
 21+ --<ID> : The ID of the existing user to use as the "reviewer" (you can find your ID at Special:Preferences)
 22+ --<CALL> : One of revs,pages,templates, or images
 23+
 24+TEXT;
 25+ exit(0);
 26+}
 27+
1228 error_reporting( E_ALL );
1329
14 -$start = isset($args[0]) ? $args[0] : NULL;
 30+$start = isset($options['start']) ? $options['start'] : NULL;
 31+$updateonly = isset($options['updateonly']) ? $options['updateonly'] : NULL;
1532
 33+$actions = array( 'revs', 'pages', 'templates', 'images' );
 34+if( $updateonly && in_array($updateonly,$actions) ) {
 35+ $do = "update_flagged{$updateonly}";
 36+ $do($start);
 37+ exit(0);
 38+}
 39+
1640 update_flaggedrevs($start);
1741
1842 update_flaggedpages($start);

Status & tagging log