$wgUser = User::newFromName( $userName );
}
if ( !$wgUser ) {
- $this->error( "Invalid username", true );
+ $this->fatalError( "Invalid username" );
}
if ( $wgUser->isAnon() ) {
$wgUser->addToDatabase();
$title = Title::newFromText( $this->getArg() );
if ( !$title ) {
- $this->error( "Invalid title", true );
+ $this->fatalError( "Invalid title" );
}
if ( $this->hasOption( 'nocreate' ) && !$title->exists() ) {
- $this->error( "Page does not exist", true );
+ $this->fatalError( "Page does not exist" );
} elseif ( $this->hasOption( 'createonly' ) && $title->exists() ) {
- $this->error( "Page already exists", true );
+ $this->fatalError( "Page already exists" );
}
$page = WikiPage::factory( $title );
$exit = 1;
}
if ( !$status->isGood() ) {
- $this->output( $status->getWikiText() . "\n" );
+ $this->output( $status->getWikiText( false, false, 'en' ) . "\n" );
}
exit( $exit );
}
}
-$maintClass = "EditCLI";
+$maintClass = EditCLI::class;
require_once RUN_MAINTENANCE_IF_MAIN;