Beispiel #1
0
 static function flash()
 {
     if (Registry::test('flash') || Registry::test('default->flash')) {
         echo Registry::get('flash');
     } else {
         Registry::addDebug('<div class="error">ERROR: no <i>:flash</i> set for function flash</div>');
     }
 }
 static function title()
 {
     echo Registry::test('title') ? Registry::get('title') : 'Default title';
 }
Beispiel #3
0
 *
 * @author Corey Ray
 */
define('REGISTRY_LOAD_START', true);
class Registry
{
    private static $_data = array();
    private static function set($key, $data)
    {
        self::$_data[$key] = $data;
    }
    private static function get($key)
    {
        return self::$_data[$key];
    }
    public static function register()
    {
    }
    public function __call($name, $arguments)
    {
        if (empty($arguments)) {
            return $this->get($name);
        }
        $this->set($name, $arguments[0]);
    }
}
$r = new Registry();
$r->test('7654145215');
echo $r->test();
echo '';
define('REGISTRY_LOAD_COMPLETE', true);