* @ingroup Maintenance
*/
-require_once( "Maintenance.php" );
+require_once( dirname(__FILE__) . '/Maintenance.php' );
class EditCLI extends Maintenance {
public function __construct() {
$this->addOption( 'b', 'Bot edit' );
$this->addOption( 'a', 'Enable autosummary' );
$this->addOption( 'no-rc', 'Do not show the change in recent changes' );
- $this->addArgs( array( 'title' ) );
+ $this->addArg( 'title', 'Title of article to edit' );
}
public function execute() {
$wgUser = User::newFromName( $userName );
if ( !$wgUser ) {
- $this->error( "Invalid username\n", true );
+ $this->error( "Invalid username", true );
}
if ( $wgUser->isAnon() ) {
$wgUser->addToDatabase();
$wgTitle = Title::newFromText( $this->getArg() );
if ( !$wgTitle ) {
- $this->error( "Invalid title\n", true );
+ $this->error( "Invalid title", true );
}
$wgArticle = new Article( $wgTitle );