* e.g. immobile_namespace for namespaces which can't be moved
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
/**
$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();
}
# 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 ) {
$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' ) );