<?php
/**
- * @todo document
* @addtogroup Maintenance
*/
if( isset( $options['help'] ) ) {
echo <<<TEXT
-usage: php refreshLinks.php start [-e end] [-m maxlag] [--help] [possibly other
- stuff]
-
- --help : This help message
- --dfn-only : ???
- -m <number> : Specifies max replication lag? Does it abort or wait if this
- is exceeded?
- start : First page id to refresh? Doesn't work with --dfn-only set?
- -e <number> : Last page id to refresh?
-
-This uses wfGetDB() to get the database, it seems not to accept a database ar-
-gument on the command line. So I don't know if you can use it for non-default
-configuration.
-
-Todo: Real documentation.
+Usage:
+ php refreshLinks.php --help
+ php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] [--dfn-only]
+ [--new-only] [--redirects-only]
+ php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] --old-redirects-only
+
+ --help : This help message
+ --dfn-only : Delete links from nonexistent articles only
+ --new-only : Only affect articles with just a single edit
+ --redirects-only : Only fix redirects, not all links
+ --old-redirects-only : Only fix redirects with no redirect table entry
+ -m <number> : Maximum replication lag
+ <start> : First page id to refresh
+ -e <number> : Last page id to refresh
TEXT;
exit(0);
error_reporting( E_ALL & (~E_NOTICE) );
if ( !$options['dfn-only'] ) {
- if ($args[0]) {
+ if ( isset( $args[0] ) ) {
$start = (int)$args[0];
} else {
$start = 1;
}
- refreshLinks( $start, $options['new-only'], $options['m'], $options['e'], $options['redirects-only'] );
+ refreshLinks( $start, $options['new-only'], $options['m'], $options['e'], $options['redirects-only'], $options['old-redirects-only'] );
}
// this bit's bad for replication: disabling temporarily
// --brion 2005-07-16