Merge "Print chained exceptions when maintenance script fails."
[lhc/web/wiklou.git] / maintenance / moveBatch.php
index 090c3d4..47828e6 100644 (file)
@@ -65,8 +65,8 @@ class MoveBatch extends Maintenance {
                $reason = $this->getOption( 'r', '' );
                $interval = $this->getOption( 'i', 0 );
                $noredirects = $this->hasOption( 'noredirects' );
-               if ( $this->hasArg() ) {
-                       $file = fopen( $this->getArg(), 'r' );
+               if ( $this->hasArg( 0 ) ) {
+                       $file = fopen( $this->getArg( 0 ), 'r' );
                } else {
                        $file = $this->getStdin();
                }
@@ -86,7 +86,6 @@ class MoveBatch extends Maintenance {
 
                # Setup complete, now start
                $dbw = $this->getDB( DB_MASTER );
-               // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
                for ( $linenum = 1; !feof( $file ); $linenum++ ) {
                        $line = fgets( $file );
                        if ( $line === false ) {
@@ -117,7 +116,6 @@ class MoveBatch extends Maintenance {
                        if ( $interval ) {
                                sleep( $interval );
                        }
-                       wfWaitForSlaves();
                }
        }
 }