Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Registry {
- protected static $data = array();
- // this is a static class
- final private function __construct()
- {
- }
- public static function set($key, $value)
- {
- self::$data[$key] = $value;
- }
- public static function get($key, $default = NULL)
- {
- if (isset(self::$data[$key])) {
- return self::$data[$key];
- } else {
- return $default;
- }
- }
- }
Add Comment
Please, Sign In to add comment