Merge remote-tracking branch 'upstream/4.4' into 4.4-4.5-2014-09-01-22-48-29
[civicrm-core.git] / CRM / Utils / Cache / Memcached.php
index 9fcaff8261e9dd21fda63000acfa386e59e44c0f..b07eef40aa3a16f3462c6531229ae9f9a3847a32 100644 (file)
@@ -108,6 +108,13 @@ class CRM_Utils_Cache_Memcached {
     }
   }
 
+  /**
+   * @param $key
+   * @param $value
+   *
+   * @return bool
+   * @throws Exception
+   */
   function set($key, &$value) {
     $key = $this->cleanKey($key);
     if (!$this->_cache->set($key, $value, $this->_timeout)) {
@@ -118,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 ) {
@@ -139,6 +161,9 @@ class CRM_Utils_Cache_Memcached {
     return $key;
   }
 
+  /**
+   * @return mixed
+   */
   function flush() {
     return $this->_cache->flush();
   }