if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) {
if ( !is_null( $oldid ) ) {
// Don't use the parser cache
- $rev = Revision::newFromID( $oldid );
+ $rev = Revision::newFromId( $oldid );
if ( !$rev ) {
$this->dieUsage( "There is no revision ID $oldid", 'missingrev' );
}
$result_array['wikitext'] = array();
ApiResult::setContent( $result_array['wikitext'], $this->content->serialize( $format ) );
}
+ if ( !is_null( $params['summary'] ) ) {
+ $result_array['parsedsummary'] = array();
+ ApiResult::setContent(
+ $result_array['parsedsummary'],
+ Linker::formatComment( $params['summary'], $titleObj )
+ );
+ }
+
$result->addValue( null, $this->getModuleName(), $result_array );
return;
// Link flags are ignored for now, but may in the future be
// included in the result.
$linkFlags = array();
- wfRunHooks( 'LanguageLinks', array( $titleObj, &$langlinks, &$linkFlags ) );
+ Hooks::run( 'LanguageLinks', array( $titleObj, &$langlinks, &$linkFlags ) );
}
} else {
$langlinks = false;
$this->dieUsage( "generatexml is only supported for wikitext content", "notwikitext" );
}
- $wgParser->startExternalParse( $titleObj, $popts, OT_PREPROCESS );
+ $wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS );
$dom = $wgParser->preprocessToDom( $this->content->getNativeData() );
if ( is_callable( array( $dom, 'saveXML' ) ) ) {
$xml = $dom->saveXML();
* @return ParserOptions
*/
protected function makeParserOptions( WikiPage $pageObj, array $params ) {
- wfProfileIn( __METHOD__ );
$popts = $pageObj->makeParserOptions( $this->getContext() );
$popts->enableLimitReport( !$params['disablepp'] );
$popts->setIsSectionPreview( $params['sectionpreview'] );
$popts->setEditSection( !$params['disableeditsection'] );
- wfProfileOut( __METHOD__ );
-
return $popts;
}
);
}
- public function getExamplesMessages() {
+ protected function getExamplesMessages() {
return array(
'action=parse&page=Project:Sandbox'
=> 'apihelp-parse-example-page',