* @ingroup Maintenance
*/
+use MediaWiki\Revision\SlotRecord;
+
require_once __DIR__ . '/Maintenance.php';
/**
$bot = $this->hasOption( 'bot' );
$autoSummary = $this->hasOption( 'autosummary' );
$noRC = $this->hasOption( 'no-rc' );
- $slot = $this->getOption( 'slot', 'main' );
+ $slot = $this->getOption( 'slot', SlotRecord::MAIN );
if ( $userName === false ) {
$wgUser = User::newSystemUser( 'Maintenance script', [ 'steal' => true ] );
$wgUser->addToDatabase();
}
- $title = Title::newFromText( $this->getArg() );
+ $title = Title::newFromText( $this->getArg( 0 ) );
if ( !$title ) {
$this->fatalError( "Invalid title" );
}
$page = WikiPage::factory( $title );
if ( $remove ) {
- if ( $slot === 'main' ) {
+ if ( $slot === SlotRecord::MAIN ) {
$this->fatalError( "Cannot remove main slot! Use --slot to specify." );
}