Update documentation for ParserCache::save()
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Mon, 30 Dec 2013 16:11:52 +0000 (17:11 +0100)
committerSiebrand <siebrand@wikimedia.org>
Thu, 2 Jan 2014 14:13:19 +0000 (14:13 +0000)
The second parameter is a WikiPage, not an Article. Rename the variable
to $page to avoid confusion.

Change-Id: I4655aa9d8c7469805362c8ec43559bb5f9be4b06

includes/parser/ParserCache.php

index dae0c68..9eaa3e2 100644 (file)
@@ -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<!-- Saved in parser cache with key $parserOutputKey and timestamp $cacheTime\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" );
                }