X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiParse.php;h=83d2cbc0bdcf110708efe95ffa035894edd3aa09;hb=1622cef1e2d8583b0fe98aa10c425a1594e7cc0f;hp=d25c87ac19fce9a2be6d75ac0358ba1c1de25570;hpb=201928033d59d5f5bccadac48bc4a10c27a0384a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index d25c87ac19..83d2cbc0bd 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -87,7 +87,7 @@ class ApiParse extends ApiBase { 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' ); } @@ -267,7 +267,7 @@ class ApiParse extends ApiBase { // 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; @@ -376,7 +376,7 @@ class ApiParse extends ApiBase { $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(); @@ -419,7 +419,6 @@ class ApiParse extends ApiBase { * @return ParserOptions */ protected function makeParserOptions( WikiPage $pageObj, array $params ) { - wfProfileIn( __METHOD__ ); $popts = $pageObj->makeParserOptions( $this->getContext() ); $popts->enableLimitReport( !$params['disablepp'] ); @@ -427,8 +426,6 @@ class ApiParse extends ApiBase { $popts->setIsSectionPreview( $params['sectionpreview'] ); $popts->setEditSection( !$params['disableeditsection'] ); - wfProfileOut( __METHOD__ ); - return $popts; } @@ -721,7 +718,7 @@ class ApiParse extends ApiBase { ); } - public function getExamplesMessages() { + protected function getExamplesMessages() { return array( 'action=parse&page=Project:Sandbox' => 'apihelp-parse-example-page',