From 0eb2e0c6d887d106de87c30f2d502b93e144cc8a Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 30 Dec 2013 17:11:52 +0100 Subject: [PATCH] Update documentation for ParserCache::save() The second parameter is a WikiPage, not an Article. Rename the variable to $page to avoid confusion. Change-Id: I4655aa9d8c7469805362c8ec43559bb5f9be4b06 --- includes/parser/ParserCache.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index dae0c68ae3..9eaa3e25ac 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -213,11 +213,11 @@ class ParserCache { /** * @param ParserOutput $parserOutput - * @param Article $article + * @param WikiPage $page * @param ParserOptions $popts * @param string $cacheTime Time when the cache was generated */ - public function save( $parserOutput, $article, $popts, $cacheTime = null ) { + public function save( $parserOutput, $page, $popts, $cacheTime = null ) { $expire = $parserOutput->getCacheExpiry(); if ( $expire > 0 ) { $cacheTime = $cacheTime ?: wfTimestampNow(); @@ -231,11 +231,11 @@ class ParserCache { $optionsKey->setContainsOldMagic( $parserOutput->containsOldMagic() ); - $parserOutputKey = $this->getParserOutputKey( $article, - $popts->optionsHash( $optionsKey->mUsedOptions, $article->getTitle() ) ); + $parserOutputKey = $this->getParserOutputKey( $page, + $popts->optionsHash( $optionsKey->mUsedOptions, $page->getTitle() ) ); // Save the timestamp so that we don't have to load the revision row on view - $parserOutput->setTimestamp( $article->getTimestamp() ); + $parserOutput->setTimestamp( $page->getTimestamp() ); $parserOutput->mText .= "\n\n"; wfDebug( "Saved in parser cache with key $parserOutputKey and timestamp $cacheTime\n" ); @@ -244,7 +244,7 @@ class ParserCache { $this->mMemc->set( $parserOutputKey, $parserOutput, $expire ); // ...and its pointer - $this->mMemc->set( $this->getOptionsKey( $article ), $optionsKey, $expire ); + $this->mMemc->set( $this->getOptionsKey( $page ), $optionsKey, $expire ); } else { wfDebug( "Parser output was marked as uncacheable and has not been saved.\n" ); } -- 2.20.1