| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- /** @package verysimple::Phreeze */
- /** import supporting libraries */
- require_once("ICache.php");
- /**
- * CacheRam is an implementation of a Cache that persists to ram for the current page load only
- *
- * @package verysimple::Phreeze
- * @author VerySimple Inc.
- * @copyright 1997-2008 VerySimple, Inc.
- * @license http://www.gnu.org/licenses/lgpl.html LGPL
- * @version 2.0
- */
- class CacheRam implements ICache
- {
- private $ram = array();
-
- public function Get($key,$flags=null)
- {
- return isset($this->ram[$key]) ? $this->ram[$key] : null;
- }
-
- public function GetKeys()
- {
- return array_keys($this->ram);
- }
-
- public function Set($key,$val,$flags=null,$timeout=null)
- {
- $this->ram[$key] = $val;
- }
- public function Delete($key)
- {
- if (isset($this->ram[$key])) unset($this->ram[$key]);
- }
-
- }
- ?>
|