X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FmoveBatch.php;h=6d14f8af5d60ddb12d962e64f96acf39dab2acbf;hb=749f15c0a80fd181e795e85d7d68bac17abe0511;hp=3c2968988ad966af5303f7e44871718e47153002;hpb=cc991d3cb0cb17c8532d4970c7f50cb1250c7ebe;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 3c2968988a..6d14f8af5d 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -64,7 +64,7 @@ class MoveBatch extends Maintenance { $user = $this->getOption( 'u', false ); $reason = $this->getOption( 'r', '' ); $interval = $this->getOption( 'i', 0 ); - $noredirects = $this->getOption( 'noredirects', false ); + $noredirects = $this->hasOption( 'noredirects' ); if ( $this->hasArg() ) { $file = fopen( $this->getArg(), 'r' ); } else { @@ -73,7 +73,7 @@ class MoveBatch extends Maintenance { # Setup if ( !$file ) { - $this->error( "Unable to read file, exiting", true ); + $this->fatalError( "Unable to read file, exiting" ); } if ( $user === false ) { $wgUser = User::newSystemUser( 'Move page script', [ 'steal' => true ] ); @@ -81,14 +81,13 @@ class MoveBatch extends Maintenance { $wgUser = User::newFromName( $user ); } if ( !$wgUser ) { - $this->error( "Invalid username", true ); + $this->fatalError( "Invalid username" ); } # Setup complete, now start $dbw = $this->getDB( DB_MASTER ); - // @codingStandardsIgnoreStart Ignore avoid function calls in a FOR loop test part warning + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ( $linenum = 1; !feof( $file ); $linenum++ ) { - // @codingStandardsIgnoreEnd $line = fgets( $file ); if ( $line === false ) { break; @@ -118,10 +117,9 @@ class MoveBatch extends Maintenance { if ( $interval ) { sleep( $interval ); } - wfWaitForSlaves(); } } } -$maintClass = "MoveBatch"; +$maintClass = MoveBatch::class; require_once RUN_MAINTENANCE_IF_MAIN;