X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fedit.php;h=825e9caf21a0d7a411c7618a7b58b67dc823d9a2;hb=1b32592d9c64226226bf77baff4b1be944db2697;hp=a279cda0d7ffc0245cd1d4f975ce6ca62cdfc58b;hpb=0245bce0171c8e6466724bbfffbd97297bcbce35;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/edit.php b/maintenance/edit.php index a279cda0d7..825e9caf21 100644 --- a/maintenance/edit.php +++ b/maintenance/edit.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\Revision\SlotRecord; + require_once __DIR__ . '/Maintenance.php'; /** @@ -55,7 +57,7 @@ class EditCLI extends Maintenance { $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 ] ); @@ -69,7 +71,7 @@ class EditCLI extends Maintenance { $wgUser->addToDatabase(); } - $title = Title::newFromText( $this->getArg() ); + $title = Title::newFromText( $this->getArg( 0 ) ); if ( !$title ) { $this->fatalError( "Invalid title" ); } @@ -83,7 +85,7 @@ class EditCLI extends Maintenance { $page = WikiPage::factory( $title ); if ( $remove ) { - if ( $slot === 'main' ) { + if ( $slot === SlotRecord::MAIN ) { $this->fatalError( "Cannot remove main slot! Use --slot to specify." ); } @@ -120,7 +122,7 @@ class EditCLI extends Maintenance { $exit = 1; } if ( !$status->isGood() ) { - $this->output( $status->getWikiText( false, false, 'en' ) . "\n" ); + $this->output( $status->getMessage( false, false, 'en' )->text() . "\n" ); } exit( $exit ); }