X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FgetText.php;h=2e8cf7705ad224f3447f2efd2f1e45a1688a0376;hb=ea0f1b5f004a9dc1cdf5568259c337d45f15ce9b;hp=c4b8cc9bffcd471975a62b4ae89e7bddf051af38;hpb=53be5c92adab85c799754775e6b68c30fed6bf9c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/getText.php b/maintenance/getText.php index c4b8cc9bff..2e8cf7705a 100644 --- a/maintenance/getText.php +++ b/maintenance/getText.php @@ -33,7 +33,7 @@ require_once __DIR__ . '/Maintenance.php'; class GetTextMaint extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = 'Outputs page text to stdout'; + $this->addDescription( 'Outputs page text to stdout' ); $this->addOption( 'show-private', 'Show the text even if it\'s not available to the public' ); $this->addArg( 'title', 'Page title' ); } @@ -42,13 +42,13 @@ class GetTextMaint extends Maintenance { $titleText = $this->getArg( 0 ); $title = Title::newFromText( $titleText ); if ( !$title ) { - $this->error( "$titleText is not a valid title.\n", true ); + $this->fatalError( "$titleText is not a valid title.\n" ); } $rev = Revision::newFromTitle( $title ); if ( !$rev ) { $titleText = $title->getPrefixedText(); - $this->error( "Page $titleText does not exist.\n", true ); + $this->fatalError( "Page $titleText does not exist.\n" ); } $content = $rev->getContent( $this->hasOption( 'show-private' ) ? Revision::RAW @@ -56,11 +56,11 @@ class GetTextMaint extends Maintenance { if ( $content === false ) { $titleText = $title->getPrefixedText(); - $this->error( "Couldn't extract the text from $titleText.\n", true ); + $this->fatalError( "Couldn't extract the text from $titleText.\n" ); } $this->output( $content->serialize() ); } } -$maintClass = "GetTextMaint"; +$maintClass = GetTextMaint::class; require_once RUN_MAINTENANCE_IF_MAIN;