Location: PHPKode > scripts > keeper > Keeper.php
<?php
/* 
 * Keeper
 * 
 * Saving variables in the instance of the Keeper
 * 
 * @category Cache
 * @package Keepr
 * @version 1.0 [beta]
 * @copyright Copyright (c) 2010 Ivan Priorov [iPrior] (hide@address.com)
 * @license GNU GPL (http://www.gnu.org/licenses/gpl.html)
 * 
 */
class Keeper extends ArrayObject {
	/*
	 * Instance of the class
	 * @var Keeper
	 */
	private static $__keeper_class;
		
	/*
	 * Return instance
	 * @return Keeper
	 */
	public static function getInstance() {
		if (!self::$__keeper_class) {
			self::$__keeper_class = new Keeper();
		}
		return self::$__keeper_class;
	}
	
	/*
	 * @param string $key
	 * @param mixed $value
	 * @return void
	 */
	public static function set($key,$value) {
		self::getInstance()->offsetSet($key, $value);
	}
	
	/*
	 * @param string $key
	 * @return mixed
	 */
	public static function get($key) {
		return self::getInstance()->offsetGet($key);
	}
	
	/*
	 * @param string $key
	 * @return bool
	 */
	public static function exists($key) {
		return self::getInstance()->offsetExists($key);
	}
}
?>
Return current item: keeper