Fix for Special:Export so it doesn't ignore the page named '0'.
[lhc/web/wiklou.git] / maintenance / refreshLinks.php
1 <?php
2 /**
3 * @addtogroup Maintenance
4 */
5
6 /** */
7 $optionsWithArgs = array( 'm', 'e' );
8
9 require_once( "commandLine.inc" );
10 require_once( "refreshLinks.inc" );
11
12 if( isset( $options['help'] ) ) {
13 echo <<<TEXT
14 Usage: php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] [--help]
15
16 --help : This help message
17 --dfn-only : Delete links from nonexistent articles only
18 -m <number> : Maximum replication lag
19 <start> : First page id to refresh
20 -e <number> : Last page id to refresh
21
22 TEXT;
23 exit(0);
24 }
25
26 error_reporting( E_ALL & (~E_NOTICE) );
27
28 if ( !$options['dfn-only'] ) {
29 if ( isset( $args[0] ) ) {
30 $start = (int)$args[0];
31 } else {
32 $start = 1;
33 }
34
35 refreshLinks( $start, $options['new-only'], $options['m'], $options['e'], $options['redirects-only'] );
36 }
37 // this bit's bad for replication: disabling temporarily
38 // --brion 2005-07-16
39 //deleteLinksFromNonexistent();
40
41 if ( $options['globals'] ) {
42 print_r( $GLOBALS );
43 }
44
45