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 $_SERVER, and $baseUri.
Referenced by Slim_Http_Request\__construct().
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;
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
◆ 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.
References $_SERVER.
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']
◆ 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.
References $_SERVER.
113 if ( $reload || is_null(self::$scheme) ) {
114 self::$scheme = ( empty(
$_SERVER[
'HTTPS']) ||
$_SERVER[
'HTTPS'] ===
'off' ) ?
'http' :
'https';
116 return self::$scheme;
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
◆ 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 $_SERVER, and $uri.
Referenced by Slim_Http_Request\__construct().
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,
'/');
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
◆ $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