X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCache%2FMemcached.php;h=b07eef40aa3a16f3462c6531229ae9f9a3847a32;hb=fdfd59ccd77f9b06547204a505b67e35bf6596d7;hp=0c406a6da11e7ec9f317f399f76a33fdc6181428;hpb=adc13f865ee7ced5d485e801528f2481fb6da0b0;p=civicrm-core.git diff --git a/CRM/Utils/Cache/Memcached.php b/CRM/Utils/Cache/Memcached.php index 0c406a6da1..b07eef40aa 100644 --- a/CRM/Utils/Cache/Memcached.php +++ b/CRM/Utils/Cache/Memcached.php @@ -1,9 +1,9 @@ cleanKey($key); if (!$this->_cache->set($key, $value, $this->_timeout)) { @@ -117,17 +125,32 @@ class CRM_Utils_Cache_Memcached { return TRUE; } + /** + * @param $key + * + * @return mixed + */ function &get($key) { $key = $this->cleanKey($key); $result = $this->_cache->get($key); return $result; } + /** + * @param $key + * + * @return mixed + */ function delete($key) { $key = $this->cleanKey($key); return $this->_cache->delete($key); } + /** + * @param $key + * + * @return mixed|string + */ function cleanKey($key) { $key = preg_replace('/\s+|\W+/', '_', $this->_prefix . $key); if ( strlen($key) > self::MAX_KEY_LEN ) { @@ -138,6 +161,9 @@ class CRM_Utils_Cache_Memcached { return $key; } + /** + * @return mixed + */ function flush() { return $this->_cache->flush(); }