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