addDescription( 'Report whether a specific page exists' ); $this->addArg( 'title', 'Page title to check whether it exists' ); } public function execute() { $titleArg = $this->getArg( 0 ); $title = Title::newFromText( $titleArg ); $pageExists = $title && $title->exists(); $code = 0; if ( $pageExists ) { $text = "{$title} exists."; } else { $text = "{$titleArg} doesn't exist."; $code = 1; } $this->output( $text ); exit( $code ); } } $maintClass = PageExists::class; require_once RUN_MAINTENANCE_IF_MAIN;