Errors and exceptions handling, #16
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@122 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -16,6 +16,8 @@ class Env
|
||||
|
||||
static protected $request = null;
|
||||
|
||||
static protected $params = array();
|
||||
|
||||
static public function getRequestUri()
|
||||
{
|
||||
if (self::$request === null) {
|
||||
@ -100,4 +102,23 @@ class Env
|
||||
$res = isset($_FILES[$name]) ? $_FILES[$name] : $default;
|
||||
return $param ? $res[$param] : $res;
|
||||
}
|
||||
|
||||
static public function getParam($key = null, $default = false)
|
||||
{
|
||||
if ($key === null) {
|
||||
return self::$params;
|
||||
}
|
||||
return (isset(self::$params[$key])) ? self::$params[$key] : $default;
|
||||
}
|
||||
|
||||
static public function setParam($key, $value)
|
||||
{
|
||||
self::$params[$key] = $value;
|
||||
}
|
||||
|
||||
static public function setParams($params = array())
|
||||
{
|
||||
self::$params = self::$params + $params;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user