diff options
Diffstat (limited to 'maintenance/refreshLinks.php')
-rw-r--r-- | maintenance/refreshLinks.php | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 4893d580..c7667520 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -5,7 +5,7 @@ */ /** */ -$optionsWithArgs = array( 'm', 'e' ); +$optionsWithArgs = array('batch-size', 'm', 'e' ); require_once( "commandLine.inc" ); require_once( "refreshLinks.inc" ); @@ -15,17 +15,19 @@ if( isset( $options['help'] ) ) { Usage: php refreshLinks.php --help php refreshLinks.php [<start>] [-e <end>] [-m <maxlag>] [--dfn-only] - [--new-only] [--redirects-only] + [--batch-size <size>] [--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 + --help : This help message + --dfn-only : Delete links from nonexistent articles only + --batch-size <number> : The delete batch size when removing links from + nonexistent articles (defaults to 100) + --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); @@ -42,12 +44,13 @@ if ( !$options['dfn-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 -//deleteLinksFromNonexistent(); -if ( $options['globals'] ) { - print_r( $GLOBALS ); +if ( !isset( $options['batch-size'] ) ) { + $options['batch-size'] = 100; } +deleteLinksFromNonexistent($options['m'], $options['batch-size']); +if ( $options['globals'] ) { + print_r( $GLOBALS ); +} |