X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCache%2FAPCcache.php;h=0a10a48b6dd5b1a7740095de7898e46838add7d4;hb=d5b9585b3da73a76dada27cfa2f791c6c4763cd5;hp=9bd6765068b61231e1bff2fc27bca1c6c454fda8;hpb=e425a965789b9e5a86069069c8fa18c50d3e2b6a;p=civicrm-core.git diff --git a/CRM/Utils/Cache/APCcache.php b/CRM/Utils/Cache/APCcache.php index 9bd6765068..0a10a48b6d 100644 --- a/CRM/Utils/Cache/APCcache.php +++ b/CRM/Utils/Cache/APCcache.php @@ -1,7 +1,7 @@ _timeout = intval($config['timeout']); } @@ -70,22 +71,38 @@ class CRM_Utils_Cache_APCcache { } } - function set($key, &$value) { + /** + * @param $key + * @param $value + * + * @return bool + */ + public function set($key, &$value) { if (!apc_store($this->_prefix . $key, $value, $this->_timeout)) { return FALSE; } return TRUE; } - function &get($key) { + /** + * @param $key + * + * @return mixed + */ + public function &get($key) { return apc_fetch($this->_prefix . $key); } - function delete($key) { + /** + * @param $key + * + * @return bool|string[] + */ + public function delete($key) { return apc_delete($this->_prefix . $key); } - function flush() { + public function flush() { $allinfo = apc_cache_info('user'); $keys = $allinfo['cache_list']; $prefix = $this->_prefix . "CRM_"; // Our keys follows this pattern: ([A-Za-z0-9_]+)?CRM_[A-Za-z0-9_]+ @@ -93,9 +110,11 @@ class CRM_Utils_Cache_APCcache { foreach ($keys as $key) { $name = $key['info']; - if ($prefix == substr($name,0,$lp)) { // Ours? + if ($prefix == substr($name, 0, $lp)) { + // Ours? apc_delete($this->_prefix . $name); } } } + }