reports: Don't validate report names in javascript
[ninja.git] / system / libraries / drivers / Cache / Apc.php
blob2fa725f8ea3b1cc53d2d6fb0f4d465b5c4f2202c
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * APC-based Cache driver.
5 * $Id: Apc.php 3917 2009-01-21 03:06:22Z zombor $
7 * @package Cache
8 * @author Kohana Team
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)
34 return FALSE;
37 public function delete($id, $tag = FALSE)
39 if ($id === TRUE)
40 return apc_clear_cache('user');
42 if ($tag == FALSE)
43 return apc_delete($id);
45 return TRUE;
48 public function delete_expired()
50 return TRUE;
53 } // End Cache APC Driver