3
* Copyright 2010-2013 Horde LLC (http://www.horde.org/)
5
* See the enclosed file COPYING for license information (LGPL). If you
6
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
9
* @copyright 2010-2013 Horde LLC
10
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11
* @link http://pear.horde.org/index.php?package=Cache
16
* Cache storage in PHP memory.
17
* It persists only during a script run and ignores the object lifetime
20
* @author Gunnar Wrobel <wrobel@pardus.de>
22
* @copyright 2010-2013 Horde LLC
23
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
24
* @link http://pear.horde.org/index.php?package=Cache
27
class Horde_Cache_Storage_Mock extends Horde_Cache_Storage_Base
30
* The storage location for this cache.
34
private $_cache = array();
38
public function __sleep()
40
throw new BadMethodCallException('Cannot serialize this object.');
45
public function get($key, $lifetime = 0)
47
return isset($this->_cache[$key])
54
public function set($key, $data, $lifetime = 0)
56
$this->_cache[$key] = $data;
61
public function exists($key, $lifetime = 0)
63
return isset($this->_cache[$key]);
68
public function expire($key)
70
unset($this->_cache[$key]);
75
public function clear()
77
$this->_cache = array();