* @copyright 2012 (c) ParsPooyesh Co * @license GPLv3 * @version GIT: $Id$ * @link http://xamin.ir */ /** * A dummy array cache * * @category Xamin * @package Handlebars * @author fzerorubigd * @copyright 2012 (c) ParsPooyesh Co * @license GPLv3 * @version Release: @package_version@ * @link http://xamin.ir */ namespace Handlebars\Cache; use Handlebars\Cache; class Dummy implements Cache { private $_cache = array(); /** * Get cache for $name if exist. * * @param string $name Cache id * * @return data on hit, boolean false on cache not found */ public function get($name) { if (array_key_exists($name, $this->_cache)) { return $this->_cache[$name]; } return false; } /** * Set a cache * * @param string $name cache id * @param mixed $value data to store * * @return void */ public function set($name, $value) { $this->_cache[$name] = $value; } /** * Remove cache * * @param string $name Cache id * * @return void */ public function remove($name) { unset($this->_cache[$name]); } }