* @ingroup Maintenance
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
/**
$files[$filename] = file_get_contents( $filename );
}
if ( !$found ) {
- $this->error( "Fatal error: The file '$arg' does not exist!", 1 );
+ $this->fatalError( "Fatal error: The file '$arg' does not exist!" );
}
}
};
}
if ( !$user ) {
- $this->error( "Invalid username\n", true );
+ $this->fatalError( "Invalid username\n" );
}
if ( $user->isAnon() ) {
$user->addToDatabase();
}
}
- $rev = new WikiRevision( ConfigFactory::getDefaultInstance()->makeConfig( 'main' ) );
+ $rev = new WikiRevision( MediaWikiServices::getInstance()->getMainConfig() );
$rev->setText( rtrim( $text ) );
$rev->setTitle( $title );
$rev->setUserObj( $user );
$this->output( "Done! $successCount succeeded, $skipCount skipped.\n" );
if ( $exit ) {
- $this->error( "Import failed with $failCount failed pages.\n", $exit );
+ $this->fatalError( "Import failed with $failCount failed pages.\n", $exit );
}
}
}