No point in fetching the result in Database::unlock() if we're not using it anyway.
[lhc/web/wiklou.git] / maintenance / refreshLinks.php
1 <?php
2 /**
3 * @file
4 * @ingroup Maintenance
5 */
6
7 /** */
8 $optionsWithArgs = array( 'm', 'e' );
9
10 require_once( "commandLine.inc" );
11 require_once( "refreshLinks.inc" );
12
13 if( isset( $options['help'] ) ) {
14 echo <<<TEXT
15 Usage:
16 php refreshLinks.php --help
17 php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] [--dfn-only]
18 [--new-only] [--redirects-only]
19 php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] --old-redirects-only
20
21 --help : This help message
22 --dfn-only : Delete links from nonexistent articles only
23 --new-only : Only affect articles with just a single edit
24 --redirects-only : Only fix redirects, not all links
25 --old-redirects-only : Only fix redirects with no redirect table entry
26 -m <number> : Maximum replication lag
27 <start> : First page id to refresh
28 -e <number> : Last page id to refresh
29
30 TEXT;
31 exit(0);
32 }
33
34 error_reporting( E_ALL & (~E_NOTICE) );
35
36 if ( !$options['dfn-only'] ) {
37 if ( isset( $args[0] ) ) {
38 $start = (int)$args[0];
39 } else {
40 $start = 1;
41 }
42
43 refreshLinks( $start, $options['new-only'], $options['m'], $options['e'], $options['redirects-only'], $options['old-redirects-only'] );
44 }
45 // this bit's bad for replication: disabling temporarily
46 // --brion 2005-07-16
47 //deleteLinksFromNonexistent();
48
49 if ( $options['globals'] ) {
50 print_r( $GLOBALS );
51 }
52
53