X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FmoveBatch.php;h=a27a77262c22f698133558431d7ca43e0396d1ff;hb=415b31766677e190c13322742b4e42da1157538c;hp=5171b177a1f44a5b8c8a89cd0f56292df49c9d82;hpb=e92d87c26c408441d8c229fc1e9c7e0bcd93898a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 5171b177a1..a27a77262c 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -82,7 +82,9 @@ class MoveBatch extends Maintenance { # Setup complete, now start $dbw = wfGetDB( DB_MASTER ); + // @codingStandardsIgnoreStart Ignore avoid function calls in a FOR loop test part warning for ( $linenum = 1; !feof( $file ); $linenum++ ) { + // @codingStandardsIgnoreEnd $line = fgets( $file ); if ( $line === false ) { break; @@ -101,10 +103,10 @@ class MoveBatch extends Maintenance { $this->output( $source->getPrefixedText() . ' --> ' . $dest->getPrefixedText() ); $dbw->begin( __METHOD__ ); - $err = $source->moveTo( $dest, false, $reason, !$noredirects ); - if ( $err !== true ) { - $msg = array_shift( $err[0] ); - $this->output( "\nFAILED: " . wfMessage( $msg, $err[0] )->text() ); + $mp = new MovePage( $source, $dest ); + $status = $mp->move( $wgUser, $reason, !$noredirects ); + if ( !$status->isOK() ) { + $this->output( "\nFAILED: " . $status->getWikiText() ); } $dbw->commit( __METHOD__ ); $this->output( "\n" );