Class Request
An HTTP request.
<?php use ICanBoogie\HTTP\Request; # Creating the main request $request = Request::from($_SERVER); # Creating a request from scratch, with the current environment. $request = Request::from([ Request::OPTION_URI => '/path/to/my/page.html?page=2', Request::OPTION_USER_AGENT => 'Mozilla' Request::OPTION_IS_GET => true, Request::OPTION_IS_XHR => true, Request::OPTION_IS_LOCAL => true ], $_SERVER);
- ICanBoogie\HTTP\Request implements ArrayAccess, IteratorAggregate, ICanBoogie\HTTP\RequestMethods, ICanBoogie\HTTP\RequestOptions uses ICanBoogie\Accessor\AccessorTrait (not available)
See: http://en.wikipedia.org/wiki/Uniform_resource_locator
Located at Request.php
Methods summary
public static
|
|
protected
|
|
public static
|
|
protected static
|
|
protected static
|
|
protected static
|
|
protected static
|
|
protected
|
#
__construct( array $properties, array $env = [] )
Initialize the properties |
public
|
|
public
|
|
public
|
|
protected
|
|
public
|
|
protected
|
|
public
mixed
|
|
public
boolean
|
|
public
mixed|null
|
|
public
|
|
public
|
|
public
ArrayIterator
|
|
protected
|
|
protected
|
|
protected
|
|
protected
string
|
|
protected
string
|
|
protected
string|null
|
|
protected
integer|null
|
|
protected
string|null
|
|
protected
string|null
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
boolean
|
|
protected
string
|
|
protected
|
|
protected
string
|
|
protected
integer
|
|
protected
string
|
|
protected
string
|
#
get_normalized_path( )
Returns the $path property normalized using the \ICanBoogie\normalize_url_path() function. |
protected
mixed
|
|
protected
|
|
protected
array
|
#
lazy_get_params( )
Returns the union of the |
Magic methods summary
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
Constants summary
Constants inherited from ICanBoogie\HTTP\RequestMethods
METHOD_ANY
,
METHOD_CONNECT
,
METHOD_DELETE
,
METHOD_GET
,
METHOD_HEAD
,
METHOD_OPTIONS
,
METHOD_PATCH
,
METHOD_POST
,
METHOD_PUT
,
METHOD_TRACE
Constants inherited from ICanBoogie\HTTP\RequestOptions
OPTION_CACHE_CONTROL
,
OPTION_CONTENT_LENGTH
,
OPTION_COOKIE
,
OPTION_FILES
,
OPTION_HEADERS
,
OPTION_IP
,
OPTION_IS_CONNECT
,
OPTION_IS_DELETE
,
OPTION_IS_GET
,
OPTION_IS_HEAD
,
OPTION_IS_LOCAL
,
OPTION_IS_OPTIONS
,
OPTION_IS_PATCH
,
OPTION_IS_POST
,
OPTION_IS_PUT
,
OPTION_IS_TRACE
,
OPTION_IS_XHR
,
OPTION_METHOD
,
OPTION_PATH
,
OPTION_PATH_PARAMS
,
OPTION_QUERY_PARAMS
,
OPTION_REFERER
,
OPTION_REQUEST_PARAMS
,
OPTION_URI
,
OPTION_USER_AGENT
Properties summary
public static
array
|
$methods
|
#
[
self::METHOD_CONNECT,
self::METHOD_DELETE,
self::METHOD_GET,
self::METHOD_HEAD,
self::METHOD_OPTIONS,
self::METHOD_POST,
self::METHOD_PUT,
self::METHOD_PATCH,
self::METHOD_TRACE
]
|
protected static
|
$current_request
Current request. |
|
public
array
|
$path_params
Parameters extracted from the request path. |
#
[]
|
public
array
|
$query_params
Parameters defined by the query string. |
#
[]
|
public
array
|
$request_params
Parameters defined by the request body. |
#
[]
|
public
array
|
$params | |
protected
|
$context
General purpose container. |
|
public
|
$headers
The headers of the request. |
|
protected
array
|
$env
Request environment. |
|
protected
|
$files
Files associated with the request. |
|
public
|
$cookie
|
|
protected
|
$parent
Parent request. |
Magic properties
public read-only
|
$context
the request's context. |
public read-only
|
$parent
Parent request. |
public read-only
|
$files
The files associated with the request. |
public read-only
boolean
|
$authorization
Authorization of the request. |
public read-only
integer
|
$content_length
Length of the request content. |
public read-only
|
$cache_control
|
public read-only
string
|
$ip
Remote IP of the request. |
public read-only
boolean
|
$is_delete
Is this a |
public read-only
boolean
|
$is_get
Is this a |
public read-only
boolean
|
$is_head
Is this a |
public read-only
boolean
|
$is_options
Is this a |
public read-only
boolean
|
$is_patch
Is this a |
public read-only
boolean
|
$is_post
Is this a |
public read-only
boolean
|
$is_put
Is this a |
public read-only
boolean
|
$is_trace
Is this a |
public read-only
boolean
|
$is_local
Is this a local request? |
public read-only
boolean
|
$is_xhr
Is this an Ajax request? |
public read-only
string
|
$method
Method of the request. |
public read-only
string
|
$normalized_path
Path of the request normalized using the \ICanBoogie\normalize_url_path() function. |
public read-only
string
|
$path
Path info of the request. |
public read-only
string
|
$extension
The extension of the path. |
public read-only
integer
|
$port
Port of the request. |
public read-only
string
|
$query_string
Query string of the request. |
public read-only
string
|
$script_name
Name of the entered script. |
public read-only
string
|
$referer
Referer of the request. |
public read-only
string
|
$user_agent
User agent of the request. |
public read-only
string
|
$uri
URI of the request. The |