class MoveBatch extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Moves a batch of pages";
+ $this->addDescription( 'Moves a batch of pages' );
$this->addOption( 'u', "User to perform move", false, true );
$this->addOption( 'r', "Reason to move page", false, true );
$this->addOption( 'i', "Interval to sleep between moves" );
$this->error( "Unable to read file, exiting", true );
}
if ( $user === false ) {
- $wgUser = User::newSystemUser( 'Move page script', array( 'steal' => true ) );
+ $wgUser = User::newSystemUser( 'Move page script', [ 'steal' => true ] );
} else {
$wgUser = User::newFromName( $user );
}
}
# Setup complete, now start
- $dbw = wfGetDB( DB_MASTER );
+ $dbw = $this->getDB( DB_MASTER );
// @codingStandardsIgnoreStart Ignore avoid function calls in a FOR loop test part warning
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
// @codingStandardsIgnoreEnd