From 6031e8666d26b99ef8d2ff0291660dfe39c3baea Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 8 Sep 2014 07:10:28 +0200 Subject: [PATCH] Enable PHP APC cache for AMS smarty --- code/web/private_php/ams/autoload/helpers.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/web/private_php/ams/autoload/helpers.php b/code/web/private_php/ams/autoload/helpers.php index 6c80813c2..ba329830b 100644 --- a/code/web/private_php/ams/autoload/helpers.php +++ b/code/web/private_php/ams/autoload/helpers.php @@ -23,6 +23,8 @@ class Helpers { global $AMS_TRANS; global $INGAME_LAYOUT; global $AMS_CACHEDIR; + global $AMS_PLUGINS; + // define('SMARTY_SPL_AUTOLOAD',1); require_once $AMS_LIB . '/smarty/libs/Smarty.class.php'; spl_autoload_register( '__autoload' ); @@ -37,8 +39,12 @@ class Helpers { $smarty -> caching = false; $smarty -> cache_lifetime = 300; + $smarty->setPluginsDir($AMS_PLUGINS); + if (function_exists('apc_cache_info')) { // production + $smarty->caching = true; + $smarty->setCachingType("apc"); $smarty->compile_check = false; }