Index: trunk/extensions/FlaggedRevs/maintenance/updateLinks.php |
— | — | @@ -5,13 +5,37 @@ |
6 | 6 | } else { |
7 | 7 | $IP = dirname(__FILE__).'/../../..'; |
8 | 8 | } |
| 9 | + |
| 10 | +$options = array( 'updateonly', 'help', 'start' ); |
9 | 11 | require "$IP/maintenance/commandLine.inc"; |
10 | 12 | require dirname(__FILE__) . '/updateLinks.inc'; |
11 | 13 | |
| 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 | + |
12 | 28 | error_reporting( E_ALL ); |
13 | 29 | |
14 | | -$start = isset($args[0]) ? $args[0] : NULL; |
| 30 | +$start = isset($options['start']) ? $options['start'] : NULL; |
| 31 | +$updateonly = isset($options['updateonly']) ? $options['updateonly'] : NULL; |
15 | 32 | |
| 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 | + |
16 | 40 | update_flaggedrevs($start); |
17 | 41 | |
18 | 42 | update_flaggedpages($start); |