X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCache%2FMemcached.php;h=b07eef40aa3a16f3462c6531229ae9f9a3847a32;hb=24f8127938dec80960d388e50fd5b89aa450b494;hp=0c406a6da11e7ec9f317f399f76a33fdc6181428;hpb=7791c05ff3b621589d135f3a01189d7f0a563db9;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(); }