addDescription( 'Show article contents on the command line' ); $this->addArg( 'title', 'Title of article to view' ); } public function execute() { $title = Title::newFromText( $this->getArg() ); if ( !$title ) { $this->fatalError( "Invalid title" ); } $page = WikiPage::factory( $title ); $content = $page->getContent( Revision::RAW ); if ( !$content ) { $this->fatalError( "Page has no content" ); } if ( !$content instanceof TextContent ) { $this->fatalError( "Non-text content models not supported" ); } $this->output( $content->getNativeData() ); } } $maintClass = ViewCLI::class; require_once RUN_MAINTENANCE_IF_MAIN;