|
@ -14,22 +14,24 @@ |
|
|
class Env |
|
|
class Env |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
static protected $request = null; |
|
|
|
|
|
|
|
|
static protected $request = array(); |
|
|
|
|
|
|
|
|
static protected $params = array(); |
|
|
static protected $params = array(); |
|
|
|
|
|
|
|
|
static public function getRequestUri() |
|
|
|
|
|
|
|
|
static public function getRequestUri($trim_base = false) |
|
|
{ |
|
|
{ |
|
|
if (self::$request === null) { |
|
|
|
|
|
|
|
|
if (!isset(self::$request[$trim_base])) { |
|
|
// removes get params
|
|
|
// removes get params
|
|
|
list(self::$request, ) = explode('?', Env::Server('REQUEST_URI')); |
|
|
|
|
|
|
|
|
list(self::$request[$trim_base], ) = explode('?', Env::Server('REQUEST_URI')); |
|
|
|
|
|
if ($trim_base) { |
|
|
// removes base url
|
|
|
// removes base url
|
|
|
$base = FrontController::getInstance()->getBaseUrl(); |
|
|
$base = FrontController::getInstance()->getBaseUrl(); |
|
|
if (($length = strlen($base)) > 0 && strpos(self::$request, $base) === 0) { |
|
|
|
|
|
self::$request = (string) substr(self::$request, $length); |
|
|
|
|
|
|
|
|
if (($length = strlen($base)) > 0 && strpos(self::$request[$trim_base], $base) === 0) { |
|
|
|
|
|
self::$request[$trim_base] = (string) substr(self::$request[$trim_base], $length); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return self::$request; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
return self::$request[$trim_base]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static public function Get($key = null, $default = null) |
|
|
static public function Get($key = null, $default = null) |
|
|