X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FmoveBatch.php;h=09f3120a97d02db6dcb8dd138fb6183c66e021da;hb=f1f9006707a2324505a9d97b32f07bf5a28aa37e;hp=9c20c67ded3c8dbc292d1358a0c567fbceb66780;hpb=1404a1f6bf6065035e74c287951b1c2126f11e55;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 9c20c67ded..09f3120a97 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -35,6 +35,8 @@ * e.g. immobile_namespace for namespaces which can't be moved */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/Maintenance.php'; /** @@ -65,8 +67,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(); } @@ -105,7 +107,8 @@ class MoveBatch extends Maintenance { $this->output( $source->getPrefixedText() . ' --> ' . $dest->getPrefixedText() ); $this->beginTransaction( $dbw, __METHOD__ ); - $mp = new MovePage( $source, $dest ); + $mp = MediaWikiServices::getInstance()->getMovePageFactory() + ->newMovePage( $source, $dest ); $status = $mp->move( $wgUser, $reason, !$noredirects ); if ( !$status->isOK() ) { $this->output( "\nFAILED: " . $status->getWikiText( false, false, 'en' ) );