Definition at line 37 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 97 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
- Elgg_Http_Request
Definition at line 150 of file Request.php.
static Elgg_Http_Request::createFromGlobals |
( |
| ) |
|
|
static |
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 279 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 412 of file Request.php.
Elgg_Http_Request::getClientIp |
( |
| ) |
|
Get the IP address of the client.
- Returns
- string
Definition at line 494 of file Request.php.
Elgg_Http_Request::getFirstUrlSegment |
( |
| ) |
|
Elgg_Http_Request::getHost |
( |
| ) |
|
Returns the host name.
- Returns
- string
- Exceptions
-
UnexpectedValueException | when the host name is invalid |
Definition at line 360 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 342 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 435 of file Request.php.
Elgg_Http_Request::getPort |
( |
| ) |
|
Returns the port on which the request is made.
- Returns
- string
Definition at line 395 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 451 of file Request.php.
Elgg_Http_Request::getRequestUri |
( |
| ) |
|
Returns the requested URI.
- Returns
- string The raw URI (i.e. not urldecoded)
Definition at line 294 of file Request.php.
Elgg_Http_Request::getScheme |
( |
| ) |
|
Gets the request's scheme.
- Returns
- string
Definition at line 331 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 322 of file Request.php.
Elgg_Http_Request::getUri |
( |
| ) |
|
Generates a normalized URI for the Request.
- Returns
- string
Definition at line 307 of file Request.php.
Elgg_Http_Request::getUrlSegments |
( |
| ) |
|
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 112 of file Request.php.
Elgg_Http_Request::isSecure |
( |
| ) |
|
Is this request using SSL.
- Returns
- bool
Definition at line 386 of file Request.php.
Elgg_Http_Request::isXmlHttpRequest |
( |
| ) |
|
Is this an ajax request.
- Returns
- bool
Definition at line 515 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 234 of file Request.php.
Elgg_Http_Request::prepareBaseUrl |
( |
| ) |
|
|
protected |
Prepares the base URL.
- Returns
- string
Definition at line 574 of file Request.php.
Elgg_Http_Request::prepareHeaders |
( |
| ) |
|
|
protected |
Get the HTTP headers from server.
- Returns
- array
Definition at line 539 of file Request.php.
Elgg_Http_Request::preparePathInfo |
( |
| ) |
|
|
protected |
Prepares the path info.
- Returns
- string path info
Definition at line 639 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 565 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 526 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: