Populate rc_deleted
[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:
15 php refreshLinks.php --help
16 php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] [--dfn-only]
17 [--new-only] [--redirects-only]
18 php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] --old-redirects-only
19
20 --help : This help message
21 --dfn-only : Delete links from nonexistent articles only
22 --new-only : Only affect articles with just a single edit
23 --redirects-only : Only fix redirects, not all links
24 --old-redirects-only : Only fix redirects with no redirect table entry
25 -m <number> : Maximum replication lag
26 <start> : First page id to refresh
27 -e <number> : Last page id to refresh
28
29 TEXT;
30 exit(0);
31 }
32
33 error_reporting( E_ALL & (~E_NOTICE) );
34
35 if ( !$options['dfn-only'] ) {
36 if ( isset( $args[0] ) ) {
37 $start = (int)$args[0];
38 } else {
39 $start = 1;
40 }
41
42 refreshLinks( $start, $options['new-only'], $options['m'], $options['e'], $options['redirects-only'], $options['old-redirects-only'] );
43 }
44 // this bit's bad for replication: disabling temporarily
45 // --brion 2005-07-16
46 //deleteLinksFromNonexistent();
47
48 if ( $options['globals'] ) {
49 print_r( $GLOBALS );
50 }
51
52