Back out r41001 for the moment ("Add log_user_text. Useful for log dumps, which are...
[lhc/web/wiklou.git] / maintenance / refreshLinks.php
index 923379e..4893d58 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * @todo document
- * @addtogroup Maintenance
+ * @file
+ * @ingroup Maintenance
  */
 
 /** */
@@ -12,21 +12,20 @@ require_once( "refreshLinks.inc" );
 
 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);
@@ -35,13 +34,13 @@ TEXT;
 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