1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * APC-based Cache driver.
5 * $Id: Apc.php 3917 2009-01-21 03:06:22Z zombor $
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, $tags, $lifetime)
27 count($tags) and Kohana
::log('error', 'Cache: tags are unsupported by the APC driver');
29 return apc_store($id, $data, $lifetime);
32 public function find($tag)
37 public function delete($id, $tag = FALSE)
40 return apc_clear_cache('user');
43 return apc_delete($id);
48 public function delete_expired()
53 } // End Cache APC Driver