Definition at line 38 of file Request.php.
Elgg\Http\Request::__construct |
( |
array |
$query = array() , |
|
|
array |
$request = array() , |
|
|
array |
$cookies = array() , |
|
|
array |
$files = array() , |
|
|
array |
$server = array() |
|
) |
| |
Create a request.
- Parameters
-
array | $query | GET parameters |
array | $request | POST parameters |
array | $cookies | COOKIE parameters |
array | $files | FILES parameters |
array | $server | SERVER parameters |
Definition at line 98 of file Request.php.
static Elgg\Http\Request::create |
( |
|
$uri, |
|
|
|
$method = 'GET' , |
|
|
|
$parameters = array() , |
|
|
|
$cookies = array() , |
|
|
|
$files = array() , |
|
|
|
$server = array() |
|
) |
| |
|
static |
Creates a Request based on a given URI and configuration.
The information contained in the URI always take precedence over the other information (server and parameters).
- Parameters
-
string | $uri | The URI |
string | $method | The HTTP method |
array | $parameters | The query (GET) or request (POST) parameters |
array | $cookies | The request cookies ($_COOKIE) |
array | $files | The request files ($_FILES) |
array | $server | The server parameters ($_SERVER) |
- Returns
Definition at line 151 of file Request.php.
static Elgg\Http\Request::createFromGlobals |
( |
| ) |
|
|
static |
Creates a request from PHP's globals.
- Returns
Definition at line 132 of file Request.php.
Elgg\Http\Request::get |
( |
|
$key, |
|
|
|
$default = null |
|
) |
| |
Get a parameter from this request.
It is better to get parameters from the appropriate public property (query, request).
- Parameters
-
string | $key | The key |
mixed | $default | The default value |
- Returns
- mixed
Definition at line 280 of file Request.php.
Elgg\Http\Request::getBaseUrl |
( |
| ) |
|
Returns the root url from which this request is executed.
The base URL never ends with a /. If the URL directly calls the executed script (e.g. index.php), this is included.
Suppose Elgg is installed at http://localhost/mysite/ :
- Returns
- string The raw url (i.e. not urldecoded)
Definition at line 413 of file Request.php.
Elgg\Http\Request::getClientIp |
( |
| ) |
|
Get the IP address of the client.
- Returns
- string
Definition at line 495 of file Request.php.
Elgg\Http\Request::getFirstUrlSegment |
( |
| ) |
|
Get first URL segment from the path info.
- See also
- ::getUrlSegments()
- Returns
- string
Definition at line 481 of file Request.php.
Elgg\Http\Request::getHost |
( |
| ) |
|
Returns the host name.
- Returns
- string
- Exceptions
-
Definition at line 361 of file Request.php.
Elgg\Http\Request::getHttpHost |
( |
| ) |
|
Returns the HTTP host being requested.
The port name will be appended to the host if it's non-standard.
- Returns
- string
Definition at line 343 of file Request.php.
Elgg\Http\Request::getPathInfo |
( |
| ) |
|
Returns the path being requested relative to the executed script.
The path info always starts with a /, does not contain the query string, and does not include the path to the Elgg installation.
Suppose Elgg is installed at http://localhost/mysite/ :
- Returns
- string The raw path (i.e. not urldecoded)
Definition at line 436 of file Request.php.
Elgg\Http\Request::getPort |
( |
| ) |
|
Returns the port on which the request is made.
- Returns
- string
Definition at line 396 of file Request.php.
Elgg\Http\Request::getQueryString |
( |
| ) |
|
Gets the normalized query string for the Request.
It builds a normalized query string, where keys/value pairs are alphabetized and have consistent escaping.
- Returns
- string|null A normalized query string for the Request
Definition at line 452 of file Request.php.
Elgg\Http\Request::getRequestUri |
( |
| ) |
|
Returns the requested URI.
- Returns
- string The raw URI (i.e. not urldecoded)
Definition at line 295 of file Request.php.
Elgg\Http\Request::getScheme |
( |
| ) |
|
Gets the request's scheme.
- Returns
- string
Definition at line 332 of file Request.php.
Elgg\Http\Request::getSchemeAndHttpHost |
( |
| ) |
|
Gets the scheme and HTTP host.
Includes port if non-standard.
- Returns
- string The scheme and HTTP host
Definition at line 323 of file Request.php.
Elgg\Http\Request::getUri |
( |
| ) |
|
Elgg\Http\Request::getUrlSegments |
( |
| ) |
|
Get URL segments from the path info.
- See also
- ::getPathInfo()
- Returns
- array
Definition at line 465 of file Request.php.
Elgg\Http\Request::initialize |
( |
array |
$query = array() , |
|
|
array |
$request = array() , |
|
|
array |
$cookies = array() , |
|
|
array |
$files = array() , |
|
|
array |
$server = array() |
|
) |
| |
|
protected |
Initialize the request.
- Parameters
-
array | $query | GET parameters |
array | $request | POST parameters |
array | $cookies | COOKIE parameters |
array | $files | FILES parameters |
array | $server | SERVER parameters |
- Returns
- void
Definition at line 113 of file Request.php.
Elgg\Http\Request::isSecure |
( |
| ) |
|
Is this request using SSL.
- Returns
- bool
Definition at line 387 of file Request.php.
Elgg\Http\Request::isXmlHttpRequest |
( |
| ) |
|
Is this an ajax request.
- Returns
- bool
Definition at line 516 of file Request.php.
static Elgg\Http\Request::normalizeQueryString |
( |
|
$qs | ) |
|
|
static |
Normalizes a query string.
It builds a normalized query string, where keys/value pairs are alphabetized, have consistent escaping and unneeded delimiters are removed.
- Parameters
-
- Returns
- string A normalized query string for the Request
Definition at line 235 of file Request.php.
Elgg\Http\Request::prepareBaseUrl |
( |
| ) |
|
|
protected |
Prepares the base URL.
- Returns
- string
Definition at line 575 of file Request.php.
Elgg\Http\Request::prepareHeaders |
( |
| ) |
|
|
protected |
Get the HTTP headers from server.
- Returns
- array
Definition at line 540 of file Request.php.
Elgg\Http\Request::preparePathInfo |
( |
| ) |
|
|
protected |
Prepares the path info.
- Returns
- string path info
Definition at line 640 of file Request.php.
Elgg\Http\Request::prepareRequestUri |
( |
| ) |
|
|
protected |
Set the request URI.
The Symfony Request object handles proxies and IIS rewrites. We are not yet.
- Returns
- string
Definition at line 566 of file Request.php.
Elgg\Http\Request::stripSlashesIfMagicQuotes |
( |
|
$data | ) |
|
|
protected |
Strip slashes if magic quotes is on.
- Parameters
-
mixed | $data | Data to strip slashes from |
- Returns
- mixed
Definition at line 527 of file Request.php.
Elgg\Http\Request::$baseUrl = null |
|
protected |
Elgg\Http\Request::$cookies |
Elgg\Http\Request::$files |
Elgg\Http\Request::$headers |
Elgg\Http\Request::$pathInfo = null |
|
protected |
Elgg\Http\Request::$query |
Elgg\Http\Request::$request |
Elgg\Http\Request::$requestUri = null |
|
protected |
Elgg\Http\Request::$server |
The documentation for this class was generated from the following file: