From: Tim Starling Date: Tue, 15 Nov 2005 12:09:31 +0000 (+0000) Subject: Save the results of the link cache update parse into the parser cache. This improves... X-Git-Tag: 1.6.0~1176 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=4e7cbbb184377780fc530148f762fd06c987d498;p=lhc%2Fweb%2Fwiklou.git Save the results of the link cache update parse into the parser cache. This improves the speed of the inevitable subsequent page view. --- diff --git a/includes/Article.php b/includes/Article.php index 3dfd273b63..5e13bf7ec6 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1423,14 +1423,10 @@ class Article { } } - # Parse the text and replace links with placeholders + # Parse the text and save it to the parser cache $wgOut = new OutputPage(); - - # Pass the current title along in case we're creating a wiki page - # which is different than the currently displayed one (e.g. image - # pages created on file uploads); otherwise, link updates will - # go wrong. - $wgOut->addWikiTextWithTitle( $text, $this->mTitle ); + $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) ); + $wgOut->addPrimaryWikiText( $text, $this ); if ( !$wgUseDumbLinkUpdate ) { # Move the current links back to the second register diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 638ec9b966..180c6a6ef3 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -266,9 +266,9 @@ class OutputPage { * Saves the text into the parser cache if possible */ function addPrimaryWikiText( $text, $cacheArticle ) { - global $wgParser, $wgParserCache, $wgUser, $wgTitle, $wgUseTidy; + global $wgParser, $wgParserCache, $wgUser, $wgUseTidy; - $parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions, true ); + $parserOutput = $wgParser->parse( $text, $cacheArticle->mTitle, $this->mParserOptions, true ); $text = $parserOutput->getText(); diff --git a/includes/Parser.php b/includes/Parser.php index 95183bd20c..14f42e602d 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3674,7 +3674,7 @@ class ParserOutput function expired( $touched ) { global $wgCacheEpoch; return $this->getCacheTime() == -1 || // parser says it's uncacheable - $this->getCacheTime() <= $touched || + $this->getCacheTime() < $touched || $this->getCacheTime() <= $wgCacheEpoch || !isset( $this->mVersion ) || version_compare( $this->mVersion, MW_PARSER_VERSION, "lt" );