1 <?php defined('SYSPATH') OR die('No direct access allowed.');
3 * APC-based Cache driver.
5 * $Id: Apc.php 4046 2009-03-05 19:23:29Z Shadowhand $
9 * @copyright (c) 2007-2008 Kohana Team
10 * @license http://kohanaphp.com/license.html
12 class Cache_Apc_Driver implements Cache_Driver {
14 public function __construct()
16 if ( ! extension_loaded('apc'))
17 throw new Kohana_Exception('cache.extension_not_loaded', 'apc');
20 public function get($id)
22 return (($return = apc_fetch($id)) === FALSE) ? NULL : $return;
25 public function set($id, $data, array $tags = NULL, $lifetime)
29 Kohana::log('error', 'Cache: tags are unsupported by the APC driver');
32 return apc_store($id, $data, $lifetime);
35 public function find($tag)
37 Kohana::log('error', 'Cache: tags are unsupported by the APC driver');
42 public function delete($id, $tag = FALSE)
46 Kohana::log('error', 'Cache: tags are unsupported by the APC driver');
51 return apc_clear_cache('user');
55 return apc_delete($id);
59 public function delete_expired()
64 } // End Cache APC Driver