From: Kunal Mehta Date: Mon, 23 Mar 2015 03:17:43 +0000 (-0700) Subject: TemplateParser: Use ObjectCache::newAccelerator() with fallback set X-Git-Tag: 1.31.0-rc.0~12021 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/Bar?a=commitdiff_plain;h=a9ae91c3621d2e081a664bcb97bd853cfb2995fb;p=lhc%2Fweb%2Fwiklou.git TemplateParser: Use ObjectCache::newAccelerator() with fallback set Change-Id: I202192f6bf509068941e9490d02a11bdedecd872 --- diff --git a/includes/TemplateParser.php b/includes/TemplateParser.php index b105ca493c..3de70fa2a2 100644 --- a/includes/TemplateParser.php +++ b/includes/TemplateParser.php @@ -103,11 +103,7 @@ class TemplateParser { // See if the compiled PHP code is stored in cache. // CACHE_ACCEL throws an exception if no suitable object cache is present, so fall // back to CACHE_ANYTHING. - try { - $cache = wfGetCache( CACHE_ACCEL ); - } catch ( Exception $e ) { - $cache = wfGetCache( CACHE_ANYTHING ); - } + $cache = ObjectCache::newAccelerator( array(), CACHE_ANYTHING ); $key = wfMemcKey( 'template', $templateName, $fastHash ); $code = $this->forceRecompile ? null : $cache->get( $key );