public function get($id, $default = NULL) { // dont get values when caching is disabled if (Arr::get($this->_config, 'disabled', FALSE)) { return $default; } return parent::get($id, $default); }
/** * Retrieve a cached value entry by id. * * // Retrieve cache entry from memcache group * $data = Cache::instance('memcache')->get('foo'); * * // Retrieve cache entry from memcache group and return 'bar' if miss * $data = Cache::instance('memcache')->get('foo', 'bar'); * * @param string id of cache to entry * @param string default value to return if cache miss * @return mixed * @throws Kohana_Cache_Exception */ public function get($id, $default = NULL) { if ($this->_config['profiling'] === TRUE) { $benchmark = Profiler::start("Cache Items", $id); } $data = parent::get($id, $default); if (isset($benchmark)) { if (!$data) { Profiler::delete($benchmark); } else { Profiler::stop($benchmark); } } return $data; }