From: Platonides Date: Mon, 7 Mar 2011 19:13:19 +0000 (+0000) Subject: Merge corrected r81741 and resolve the TODO. X-Git-Tag: 1.31.0-rc.0~31572 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=9a59164dbfbf26a756558f10beeb6aedeba0cbf3;p=lhc%2Fweb%2Fwiklou.git Merge corrected r81741 and resolve the TODO. Keep disabled with a class constant. --- diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index fbf7bb21c7..f19170bc71 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -11,6 +11,7 @@ */ class ParserCache { private $mMemc; + const try116cache = false; /* Only useful $wgParserCacheExpireTime after updating to 1.17 */ /** * Get an instance of this object @@ -118,8 +119,9 @@ class ParserCache { $usedOptions = $optionsKey->mUsedOptions; wfDebug( "Parser cache options found.\n" ); } else { - # TODO: Fail here $wgParserCacheExpireTime after deployment unless $useOutdated - + if ( !$useOutdated && !self::try116cache ) { + return false; + } $usedOptions = ParserOptions::legacyOptions(); } @@ -150,6 +152,11 @@ class ParserCache { } $value = $this->mMemc->get( $parserOutputKey ); + if ( self::try116cache && !$value && strpos( $value, '*' ) !== -1 ) { + wfDebug( "New format parser cache miss.\n" ); + $parserOutputKey = $this->getParserOutputKey( $article, $popts->optionsHash( ParserOptions::legacyOptions() ) ); + $value = $this->mMemc->get( $parserOutputKey ); + } if ( !$value ) { wfDebug( "Parser cache miss.\n" ); wfIncrStats( "pcache_miss_absent" );