30require_once __DIR__ .
'/Maintenance.php';
40 parent::__construct();
41 $this->
addDescription(
'Show article contents on the command line' );
42 $this->
addArg(
'title',
'Title of article to view' );
46 $title = Title::newFromText( $this->
getArg( 0 ) );
49 } elseif ( $title->isSpecialPage() ) {
50 $this->
fatalError(
"Special Pages not supported" );
51 } elseif ( !$title->exists() ) {
57 $content = $page->getContent( RevisionRecord::RAW );
62 $this->
fatalError(
"Non-text content models not supported" );
65 $this->
output( $content->getText() );
71require_once RUN_MAINTENANCE_IF_MAIN;
Content object implementation for representing flat text.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addArg( $arg, $description, $required=true, $multi=false)
Add some args that are needed.
getArg( $argId=0, $default=null)
Get an argument.
output( $out, $channel=null)
Throw some output to the user.
fatalError( $msg, $exitCode=1)
Output a message and terminate the current script.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.
Maintenance script to show page contents.
execute()
Do the actual work.
__construct()
Default constructor.