From: Sam Reed Date: Sun, 2 Jan 2011 03:20:45 +0000 (+0000) Subject: ApiQueryRevisions: Switch from manual Cache checking, to use $article->getParserOutput() X-Git-Tag: 1.31.0-rc.0~32895 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=5b1a5aa76327d9391c468e29e46063540d132537;p=lhc%2Fweb%2Fwiklou.git ApiQueryRevisions: Switch from manual Cache checking, to use $article->getParserOutput() ApiParse: Fix comment typo --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 42a0047e60..6fb0489c1a 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -282,7 +282,7 @@ class ApiParse extends ApiBase { * @param $articleObj Article * @param $titleObj Title * @param $pageId Int - * @param $pots ParserOptions + * @param $popts ParserOptions * @return ParserOutput */ private function getParsedSectionOrText( $articleObj, $titleObj, $popts, $pageId = null ) { diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 5565555b34..6c1581ad52 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -479,25 +479,10 @@ class ApiQueryRevisions extends ApiQueryBase { $text = $wgParser->preprocess( $text, $title, new ParserOptions() ); } if ( $this->parseContent ) { - global $wgEnableParserCache; - - $popts = new ParserOptions(); - $popts->setTidy( true ); - $articleObj = new Article( $title ); - $p_result = false; + $p_result = $articleObj->getParserOutput(); $pcache = ParserCache::singleton(); - if ( $wgEnableParserCache ) { - $p_result = $pcache->get( $articleObj, $popts ); - } - if ( !$p_result ) { - $p_result = $wgParser->parse( $text, $title, $popts ); - - if ( $wgEnableParserCache ) { - $pcache->save( $p_result, $articleObj, $popts ); - } - } $text = $p_result->getText(); }