Created
September 27, 2012 09:18
-
-
Save bakura10/3793064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Common\Registry; | |
class Registry | |
{ | |
/** | |
* @var array | |
*/ | |
protected static $container = array(); | |
/** | |
* Set a value in the registry | |
* | |
* @static | |
* @param mixed $key | |
* @param mixed $value | |
*/ | |
public static function set($key, $value) | |
{ | |
self::$container[$key] = $value; | |
} | |
/** | |
* @static | |
* @param mixed $key | |
* @return mixed | |
*/ | |
public static function get($key) | |
{ | |
return self::$container[$key]; | |
} | |
/** | |
* @static | |
* @param mixed $key | |
*/ | |
public static function remove($key) | |
{ | |
unset(self::$container[$key]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment