From: Ori Livneh Date: Tue, 23 Jun 2015 03:38:43 +0000 (-0700) Subject: Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache X-Git-Tag: 1.31.0-rc.0~11008^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=b0a79e924553281ac55e43a7d4849595c17d34eb;p=lhc%2Fweb%2Fwiklou.git Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache 'isParserCachedUsed' implies that the parser cache usage has already occurred, and obscures the true purpose of this method, which is to determine whether or not the requested page *should* be looked up in the parser cache. Only usage in extensions is in TextExtracts, which I changed to be both backward- and forward-compatible in If5d5da8eab13. Change-Id: I7de67937f0e57b1dffb466319192e4d400b867de --- diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index b25bf14f05..468c7e9581 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -1023,7 +1023,7 @@ abstract class ContentHandler { /** * Returns true for content models that support caching using the - * ParserCache mechanism. See WikiPage::isParserCacheUsed(). + * ParserCache mechanism. See WikiPage::shouldCheckParserCache(). * * @since 1.21 * diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index 687855a402..dec944a80d 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -185,7 +185,7 @@ class RefreshLinksJob extends Job { // wasted CPU by other apaches or job runners. We don't want to always save to // cache as this can cause high cache I/O and LRU churn when a template changes. if ( $elapsed >= self::PARSE_THRESHOLD_SEC - && $page->isParserCacheUsed( $parserOptions, $revision->getId() ) + && $page->shouldCheckParserCache( $parserOptions, $revision->getId() ) && $parserOutput->isCacheable() ) { $ctime = wfTimestamp( TS_MW, (int)$start ); // cache time diff --git a/includes/page/Article.php b/includes/page/Article.php index f373eaa1bb..450251a851 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -574,7 +574,7 @@ class Article implements Page { } # Should the parser cache be used? - $useParserCache = $this->mPage->isParserCacheUsed( $parserOptions, $oldid ); + $useParserCache = $this->mPage->shouldCheckParserCache( $parserOptions, $oldid ); wfDebug( 'Article::view using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" ); if ( $user->getStubThreshold() ) { $this->getContext()->getStats()->increment( 'pcache_miss_stub' ); diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index ad5842115e..f7f25289b5 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1085,7 +1085,7 @@ class WikiPage implements Page, IDBAccessObject { * @param int $oldId * @return bool */ - public function isParserCacheUsed( ParserOptions $parserOptions, $oldId ) { + public function shouldCheckParserCache( ParserOptions $parserOptions, $oldId ) { return $parserOptions->getStubThreshold() == 0 && $this->exists() && ( $oldId === null || $oldId === 0 || $oldId === $this->getLatest() ) @@ -1105,7 +1105,7 @@ class WikiPage implements Page, IDBAccessObject { */ public function getParserOutput( ParserOptions $parserOptions, $oldid = null ) { - $useParserCache = $this->isParserCacheUsed( $parserOptions, $oldid ); + $useParserCache = $this->shouldCheckParserCache( $parserOptions, $oldid ); wfDebug( __METHOD__ . ': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" ); if ( $parserOptions->getStubThreshold() ) { wfIncrStats( 'pcache.miss.stub' );