dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Avoid calling rollback() in setVisibility() when nothing changed"
[lhc/web/wiklou.git]
/
includes
/
parser
/
ParserCache.php
diff --git
a/includes/parser/ParserCache.php
b/includes/parser/ParserCache.php
index
916cfc2
..
c6265a7
100644
(file)
--- a/
includes/parser/ParserCache.php
+++ b/
includes/parser/ParserCache.php
@@
-146,14
+146,17
@@
class ParserCache {
if ( !$useOutdated && $optionsKey->expired( $article->getTouched() ) ) {
wfIncrStats( "pcache.miss.expired" );
$cacheTime = $optionsKey->getCacheTime();
if ( !$useOutdated && $optionsKey->expired( $article->getTouched() ) ) {
wfIncrStats( "pcache.miss.expired" );
$cacheTime = $optionsKey->getCacheTime();
- wfDebug( "Parser options key expired, touched " . $article->getTouched()
+ wfDebugLog( "ParserCache",
+ "Parser options key expired, touched " . $article->getTouched()
. ", epoch $wgCacheEpoch, cached $cacheTime\n" );
return false;
. ", epoch $wgCacheEpoch, cached $cacheTime\n" );
return false;
- } elseif ( $optionsKey->isDifferentRevision( $article->getLatest() ) ) {
+ } elseif (
!$useOutdated &&
$optionsKey->isDifferentRevision( $article->getLatest() ) ) {
wfIncrStats( "pcache.miss.revid" );
$revId = $article->getLatest();
$cachedRevId = $optionsKey->getCacheRevisionId();
wfIncrStats( "pcache.miss.revid" );
$revId = $article->getLatest();
$cachedRevId = $optionsKey->getCacheRevisionId();
- wfDebug( "ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n" );
+ wfDebugLog( "ParserCache",
+ "ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n"
+ );
return false;
}
return false;
}
@@
-201,6
+204,7
@@
class ParserCache {
}
$casToken = null;
}
$casToken = null;
+ /** @var ParserOutput $value */
$value = $this->mMemc->get( $parserOutputKey, $casToken, BagOStuff::READ_VERIFIED );
if ( !$value ) {
wfDebug( "ParserOutput cache miss.\n" );
$value = $this->mMemc->get( $parserOutputKey, $casToken, BagOStuff::READ_VERIFIED );
if ( !$value ) {
wfDebug( "ParserOutput cache miss.\n" );
@@
-222,14
+226,15
@@
class ParserCache {
if ( !$useOutdated && $value->expired( $touched ) ) {
wfIncrStats( "pcache.miss.expired" );
$cacheTime = $value->getCacheTime();
if ( !$useOutdated && $value->expired( $touched ) ) {
wfIncrStats( "pcache.miss.expired" );
$cacheTime = $value->getCacheTime();
- wfDebug( "ParserOutput key expired, touched $touched, "
+ wfDebugLog( "ParserCache",
+ "ParserOutput key expired, touched $touched, "
. "epoch $wgCacheEpoch, cached $cacheTime\n" );
$value = false;
. "epoch $wgCacheEpoch, cached $cacheTime\n" );
$value = false;
- } elseif ( $value->isDifferentRevision( $article->getLatest() ) ) {
+ } elseif (
!$useOutdated &&
$value->isDifferentRevision( $article->getLatest() ) ) {
wfIncrStats( "pcache.miss.revid" );
$revId = $article->getLatest();
$cachedRevId = $value->getCacheRevisionId();
wfIncrStats( "pcache.miss.revid" );
$revId = $article->getLatest();
$cachedRevId = $value->getCacheRevisionId();
- wfDebug
(
+ wfDebug
Log( "ParserCache",
"ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n"
);
$value = false;
"ParserOutput key is for an old revision, latest $revId, cached $cachedRevId\n"
);
$value = false;
@@
-237,7
+242,7
@@
class ParserCache {
Hooks::run( 'RejectParserCacheValue', [ $value, $wikiPage, $popts ] ) === false
) {
wfIncrStats( 'pcache.miss.rejected' );
Hooks::run( 'RejectParserCacheValue', [ $value, $wikiPage, $popts ] ) === false
) {
wfIncrStats( 'pcache.miss.rejected' );
- wfDebug
(
+ wfDebug
Log( "ParserCache",
"ParserOutput key valid, but rejected by RejectParserCacheValue hook handler.\n"
);
$value = false;
"ParserOutput key valid, but rejected by RejectParserCacheValue hook handler.\n"
);
$value = false;
@@
-257,7
+262,7
@@
class ParserCache {
*/
public function save( $parserOutput, $page, $popts, $cacheTime = null, $revId = null ) {
$expire = $parserOutput->getCacheExpiry();
*/
public function save( $parserOutput, $page, $popts, $cacheTime = null, $revId = null ) {
$expire = $parserOutput->getCacheExpiry();
- if ( $expire > 0 ) {
+ if ( $expire > 0
&& !$this->mMemc instanceof EmptyBagOStuff
) {
$cacheTime = $cacheTime ?: wfTimestampNow();
if ( !$revId ) {
$revision = $page->getRevision();
$cacheTime = $cacheTime ?: wfTimestampNow();
if ( !$revId ) {
$revision = $page->getRevision();
@@
-297,7
+302,7
@@
class ParserCache {
'ParserCacheSaveComplete',
[ $this, $parserOutput, $page->getTitle(), $popts, $revId ]
);
'ParserCacheSaveComplete',
[ $this, $parserOutput, $page->getTitle(), $popts, $revId ]
);
- } else {
+ } else
if ( $expire <= 0 )
{
wfDebug( "Parser output was marked as uncacheable and has not been saved.\n" );
}
}
wfDebug( "Parser output was marked as uncacheable and has not been saved.\n" );
}
}