get($key))); } /** * Get an item from the cache. * * @param string $key * @return mixed */ public function get($key) { if (array_key_exists($key, $this->items)) { return $this->items[$key]; } $cache = \System\Memcached::instance()->get(\System\Config::get('cache.key').$key); if ($cache === false) { return null; } return $this->items[$key] = $cache; } /** * Write an item to the cache. * * @param string $key * @param mixed $value * @param int $minutes * @return void */ public function put($key, $value, $minutes) { \System\Memcached::instance()->set(\System\Config::get('cache.key').$key, $value, 0, $minutes * 60); } /** * Delete an item from the cache. * * @param string $key * @return void */ public function forget($key) { \System\Memcached::instance()->delete(\System\Config::get('cache.key').$key); } }