Пример #1
0
{
    public static $storage;
    public static function init()
    {
        self::$storage = N2RequestStorage::$COOKIE;
    }
    static function set($var, $val)
    {
        self::$storage[$var] = $val;
    }
    static function getVar($var, $default = null)
    {
        $val = isset(self::$storage[$var]) ? self::$storage[$var] : $default;
        return $val;
    }
    static function getInt($var, $default = 0)
    {
        $val = isset(self::$storage[$var]) ? self::$storage[$var] : $default;
        return intval($val);
    }
    static function getCmd($var, $default = '')
    {
        $val = isset(self::$storage[$var]) ? self::$storage[$var] : $default;
        return preg_replace("/[^\\w_]/", "", $val);
    }
}
N2RequestStorage::init();
N2Request::init();
N2Get::init();
N2Post::init();
N2Cookie::init();