Definition at line 42 of file Uri.php.
◆ getBaseUri()
static Slim_Http_Uri::getBaseUri |
( |
|
$reload = false | ) |
|
|
static |
Get Base URI without trailing slash.
- Parameters
-
bool | $reload | Force reparse the base URI? |
- Returns
- string
Definition at line 69 of file Uri.php.
69 {
70 if ( $reload || is_null(self::$baseUri) ) {
71 $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF'];
72 $scriptName = $_SERVER['SCRIPT_NAME'];
73 $baseUri = strpos($requestUri, $scriptName) === 0 ? $scriptName : str_replace(
'\\',
'/', dirname($scriptName));
74 self::$baseUri = rtrim(
$baseUri,
'/');
75 }
77 }
References $baseUri.
Referenced by Slim_Http_Request\__construct().
◆ getQueryString()
static Slim_Http_Uri::getQueryString |
( |
|
$reload = false | ) |
|
|
static |
Get URI Query String.
- Parameters
-
bool | $reload | For reparse the URL query string? |
- Returns
- string
Definition at line 124 of file Uri.php.
124 {
125 if ( $reload || is_null(self::$queryString) ) {
126 self::$queryString = $_SERVER['QUERY_STRING'];
127 }
129 }
References $queryString.
◆ getScheme()
static Slim_Http_Uri::getScheme |
( |
|
$reload = false | ) |
|
|
static |
Get URI Scheme.
- Parameters
-
bool | $reload | For reparse the URL scheme? |
- Returns
- string "https" or "http"
Definition at line 112 of file Uri.php.
112 {
113 if ( $reload || is_null(self::$scheme) ) {
114 self::$scheme = ( empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === 'off' ) ? 'http' : 'https';
115 }
117 }
References $scheme.
◆ getUri()
static Slim_Http_Uri::getUri |
( |
|
$reload = false | ) |
|
|
static |
Get URI with leading slash.
- Parameters
-
bool | $reload | Force reparse the URI? |
- Returns
- string
- Exceptions
-
RuntimeException | If unable if unable to determine URI |
Definition at line 85 of file Uri.php.
85 {
86 if ( $reload || is_null(self::$uri) ) {
88 if ( !empty($_SERVER['PATH_INFO']) ) {
89 $uri = $_SERVER[
'PATH_INFO'];
90 } else {
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']) ) {
94 $uri = $_SERVER[
'PHP_SELF'];
95 } else {
96 throw new RuntimeException('Unable to detect request URI');
97 }
98 }
99 if ( self::getBaseUri() !==
'' && strpos(
$uri, self::getBaseUri()) === 0 ) {
100 $uri = substr(
$uri, strlen(self::getBaseUri()));
101 }
102 self::$uri =
'/' . ltrim(
$uri,
'/');
103 }
105 }
References $uri.
Referenced by Slim_Http_Request\__construct().
◆ $baseUri
◆ $queryString
Slim_Http_Uri::$queryString |
|
staticprotected |
◆ $scheme
◆ $uri
The documentation for this class was generated from the following file:
- Services/WebServices/Rest/lib/Slim/Http/Uri.php