* @ingroup Maintenance
*/
+use MediaWiki\Revision\RevisionRecord;
+
require_once __DIR__ . '/Maintenance.php';
/**
}
public function execute() {
- $title = Title::newFromText( $this->getArg() );
+ $title = Title::newFromText( $this->getArg( 0 ) );
if ( !$title ) {
- $this->error( "Invalid title", true );
+ $this->fatalError( "Invalid title" );
}
$page = WikiPage::factory( $title );
- $content = $page->getContent( Revision::RAW );
+ $content = $page->getContent( RevisionRecord::RAW );
if ( !$content ) {
- $this->error( "Page has no content", true );
+ $this->fatalError( "Page has no content" );
}
if ( !$content instanceof TextContent ) {
- $this->error( "Non-text content models not supported", true );
+ $this->fatalError( "Non-text content models not supported" );
}
- $this->output( $content->getNativeData() );
+ $this->output( $content->getText() );
}
}
-$maintClass = "ViewCLI";
+$maintClass = ViewCLI::class;
require_once RUN_MAINTENANCE_IF_MAIN;