From a9ae91c3621d2e081a664bcb97bd853cfb2995fb Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sun, 22 Mar 2015 20:17:43 -0700 Subject: [PATCH] TemplateParser: Use ObjectCache::newAccelerator() with fallback set Change-Id: I202192f6bf509068941e9490d02a11bdedecd872 --- includes/TemplateParser.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 ); -- 2.20.1