70 if ( $reload || is_null(self::$baseUri) ) {
72 $scriptName =
$_SERVER[
'SCRIPT_NAME'];
73 $baseUri = strpos($requestUri, $scriptName) === 0 ? $scriptName : str_replace(
'\\',
'/', dirname($scriptName));
74 self::$baseUri = rtrim(
$baseUri,
'/');
76 return self::$baseUri;
85 public static function getUri( $reload =
false ) {
86 if ( $reload || is_null(self::$uri) ) {
88 if ( !empty(
$_SERVER[
'PATH_INFO']) ) {
91 if ( isset(
$_SERVER[
'REQUEST_URI']) ) {
92 $uri = parse_url(self::getScheme() .
'://' .
$_SERVER[
'HTTP_HOST'] .
$_SERVER[
'REQUEST_URI'], PHP_URL_PATH);
93 }
else if ( isset(
$_SERVER[
'PHP_SELF']) ) {
99 if ( self::getBaseUri() !==
'' && strpos(
$uri, self::getBaseUri()) === 0 ) {
100 $uri = substr(
$uri, strlen(self::getBaseUri()));
102 self::$uri =
'/' . ltrim(
$uri,
'/');
113 if ( $reload || is_null(self::$scheme) ) {
114 self::$scheme = ( empty(
$_SERVER[
'HTTPS']) ||
$_SERVER[
'HTTPS'] ===
'off' ) ?
'http' :
'https';
116 return self::$scheme;
125 if ( $reload || is_null(self::$queryString) ) {
126 self::$queryString =
$_SERVER[
'QUERY_STRING'];
128 return self::$queryString;
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static getQueryString( $reload=false)
Get URI Query String.
static getScheme( $reload=false)
Get URI Scheme.
static getBaseUri( $reload=false)
Get Base URI without trailing slash.
static getUri( $reload=false)
Get URI with leading slash.