Exemplo n.º 1
0
 /**
  * get()
  *   Return item from cache if it is available.
  *
  * @param string $key
  *   The key to fetch.
  * @return mixed object|bool
  *   Returns either the cache object or FALSE on failure
  */
 function get($key)
 {
     $cache = parent::get($this->key($key));
     if (isset($cache)) {
         return $cache;
     }
     // Get item from cache
     $cache = unserialize(xcache_get($this->key($key)));
     // Update static cache
     parent::set($this->key($key), $cache);
     return $cache;
 }
Exemplo n.º 2
0
 /**
  * get()
  *   Return item from cache if it is available.
  *
  * @param string $key
  *   The key to fetch.
  * @return mixed object|bool
  *   Returns either the cache object or FALSE on failure
  */
 function get($key)
 {
     $cache = parent::get($this->key($key));
     if (isset($cache)) {
         return $cache;
     }
     $cache = apc_fetch($this->key($key));
     if (is_object($cache) && $cache->serialized) {
         $cache->data = unserialize($cache->data);
     }
     parent::set($this->key($key), $cache);
     return $cache;
 }
Exemplo n.º 3
0
 function get($key)
 {
     // Attempt to pull from static cache.
     $cache = parent::get($this->key($key));
     if (isset($cache)) {
         return $cache;
     }
     // Get from memcache
     $cache = $this->memcache->get($this->key($key));
     // Update static cache
     parent::set($this->key($key), $cache);
     return $cache;
 }
Exemplo n.º 4
0
 /**
  * get()
  *   Return item from cache if it is available.
  *
  * @param string $key
  *   The key to fetch.
  * @return mixed object|bool
  *   Returns either the cache object or FALSE on failure
  */
 function get($key)
 {
     $cache = parent::get($this->key($key));
     if (isset($cache)) {
         return $cache;
     }
     $cache = eaccelerator_get($this->key($key));
     if (!empty($cache)) {
         $cache = unserialize($cache);
     } else {
         $cache = FALSE;
     }
     parent::set($this->key($key), $cache);
     return $cache;
 }
Exemplo n.º 5
0
 function get($key)
 {
     global $user;
     $cache = parent::get($key);
     if ($cache) {
         return $cache;
     }
     $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {" . $this->name . "} WHERE cid = '%s'", $key));
     if (isset($cache->data)) {
         $cache->data = db_decode_blob($cache->data);
         if ($cache->serialized) {
             $cache->data = unserialize($cache->data);
         }
     }
     parent::set($key, $cache);
     return $cache;
 }