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.
References $baseUri.
Referenced by Slim_Http_Request\__construct().
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,
'/');
76 return self::$baseUri;
◆ 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.
125 if ( $reload || is_null(self::$queryString) ) {
126 self::$queryString = $_SERVER[
'QUERY_STRING'];
128 return self::$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.
113 if ( $reload || is_null(self::$scheme) ) {
114 self::$scheme = ( empty($_SERVER[
'HTTPS']) || $_SERVER[
'HTTPS'] ===
'off' ) ?
'http' :
'https';
116 return self::$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.
References $uri.
Referenced by Slim_Http_Request\__construct().
86 if ( $reload || is_null(self::$uri) ) {
88 if ( !empty($_SERVER[
'PATH_INFO']) ) {
89 $uri = $_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']) ) {
94 $uri = $_SERVER[
'PHP_SELF'];
96 throw new RuntimeException(
'Unable to detect request URI');
99 if ( self::getBaseUri() !==
'' && strpos(
$uri, self::getBaseUri()) === 0 ) {
100 $uri = substr(
$uri, strlen(self::getBaseUri()));
102 self::$uri =
'/' . ltrim(
$uri,
'/');
◆ $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