Cleaned up img_auth code and re-integrated core img-auth- messages.
[lhc/web/wiklou.git] / maintenance / refreshLinks.php
index 74d07be..58c789c 100644 (file)
@@ -18,7 +18,7 @@
  * @ingroup Maintenance
  */
 
-require_once( "Maintenance.php" );
+require_once( dirname(__FILE__) . '/Maintenance.php' );
 
 class RefreshLinks extends Maintenance {
        public function __construct() {
@@ -30,7 +30,7 @@ class RefreshLinks extends Maintenance {
                $this->addOption( 'old-redirects-only', 'Only fix redirects with no redirect table entry' );
                $this->addOption( 'm', 'Maximum replication lag', false, true );
                $this->addOption( 'e', 'Last page id to refresh', false, true );
-               $this->addArgs( array( 'start' => true ) );
+               $this->addArg( 'start', 'Page_id to start from, default 1' );
                $this->setBatchSize( 100 );
        }
 
@@ -91,7 +91,7 @@ class RefreshLinks extends Maintenance {
                        $num = $dbr->numRows( $res );
                        $this->output( "Refreshing $num old redirects from $start...\n" );
 
-                       while( $row = $dbr->fetchObject( $res ) ) {
+                       foreach( $res as $row ) {
                                if ( !( ++$i % $reportingInterval ) ) {
                                        $this->output( "$i\n" );
                                        wfWaitForSlaves( $maxLag );
@@ -111,7 +111,7 @@ class RefreshLinks extends Maintenance {
                        $this->output( "$num new articles...\n" );
        
                        $i = 0;
-                       while ( $row = $dbr->fetchObject( $res ) ) {
+                       foreach ( $res as $row ) {
                                if ( !( ++$i % $reportingInterval ) ) {
                                        $this->output( "$i\n" );
                                        wfWaitForSlaves( $maxLag );