From c9b4468f17952d501f51f26b6e50526989f83ffa Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 23 Mar 2011 14:09:39 +0000 Subject: [PATCH] Experimental support of APC to speed-up the application. SVN:trunk[1143] --- core/dict.class.inc.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/core/dict.class.inc.php b/core/dict.class.inc.php index 1fcaceedf..3e634f92a 100644 --- a/core/dict.class.inc.php +++ b/core/dict.class.inc.php @@ -231,5 +231,33 @@ class Dict { MyHelpers::var_dump_html(self::$m_aData); } + + public static function InCache() + { + if (function_exists('apc_fetch')) + { + $bResult = false; + self::$m_aData = apc_fetch('dict', $bResult); + if (!$bResult) + { + self::$m_aData = array(); + } + else + { + self::$m_aLanguages = apc_fetch('languages', $bResult); + } + return $bResult; + } + return false; + } + + public static function InitCache() + { + if (function_exists('apc_store')) + { + apc_store('languages', self::$m_aLanguages); + apc_store('dict', self::$m_aData); + } + } } ?>