From: Kunal Mehta Date: Sun, 11 Jun 2017 01:15:35 +0000 (-0700) Subject: Skin: Don't use parser cache in getCachedNotice() X-Git-Tag: 1.31.0-rc.0~2984^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=001f72e9ed0b8350d4e40098ee1544975776ebb6;p=lhc%2Fweb%2Fwiklou.git Skin: Don't use parser cache in getCachedNotice() Just use wfGetCache( CACHE_ANYTHING ) which should be sufficient for most cases. Change-Id: Ic97549c9649d0cc1938773b10e26f6e8f819c7fa --- diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index ccb202e65a..e9d2f076b1 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1485,7 +1485,7 @@ abstract class Skin extends ContextSource { * should fall back to the next notice in its sequence */ private function getCachedNotice( $name ) { - global $wgRenderHashAppend, $parserMemc, $wgContLang; + global $wgRenderHashAppend, $wgContLang; $needParse = false; @@ -1506,9 +1506,10 @@ abstract class Skin extends ContextSource { $notice = $msg->plain(); } + $cache = wfGetCache( CACHE_ANYTHING ); // Use the extra hash appender to let eg SSL variants separately cache. - $key = $parserMemc->makeKey( $name . $wgRenderHashAppend ); - $cachedNotice = $parserMemc->get( $key ); + $key = $cache->makeKey( $name . $wgRenderHashAppend ); + $cachedNotice = $cache->get( $key ); if ( is_array( $cachedNotice ) ) { if ( md5( $notice ) == $cachedNotice['hash'] ) { $notice = $cachedNotice['html']; @@ -1521,7 +1522,7 @@ abstract class Skin extends ContextSource { if ( $needParse ) { $parsed = $this->getOutput()->parse( $notice ); - $parserMemc->set( $key, [ 'html' => $parsed, 'hash' => md5( $notice ) ], 600 ); + $cache->set( $key, [ 'html' => $parsed, 'hash' => md5( $notice ) ], 600 ); $notice = $parsed; }