Drupal  8.3.5
APl Documentation
Request Class Reference
Inheritance diagram for Request:
ApacheRequest

Public Member Functions

 __construct (array $query=array(), array $request=array(), array $attributes=array(), array $cookies=array(), array $files=array(), array $server=array(), $content=null)
 
 initialize (array $query=array(), array $request=array(), array $attributes=array(), array $cookies=array(), array $files=array(), array $server=array(), $content=null)
 
 duplicate (array $query=null, array $request=null, array $attributes=null, array $cookies=null, array $files=null, array $server=null)
 
 __clone ()
 
 __toString ()
 
 overrideGlobals ()
 
 get ($key, $default=null, $deep=false)
 
 getSession ()
 
 hasPreviousSession ()
 
 hasSession ()
 
 setSession (SessionInterface $session)
 
 getClientIps ()
 
 getClientIp ()
 
 getScriptName ()
 
 getPathInfo ()
 
 getBasePath ()
 
 getBaseUrl ()
 
 getScheme ()
 
 getPort ()
 
 getUser ()
 
 getPassword ()
 
 getUserInfo ()
 
 getHttpHost ()
 
 getRequestUri ()
 
 getSchemeAndHttpHost ()
 
 getUri ()
 
 getUriForPath ($path)
 
 getRelativeUriForPath ($path)
 
 getQueryString ()
 
 isSecure ()
 
 getHost ()
 
 setMethod ($method)
 
 getMethod ()
 
 getRealMethod ()
 
 getMimeType ($format)
 
 getFormat ($mimeType)
 
 setFormat ($format, $mimeTypes)
 
 getRequestFormat ($default='html')
 
 setRequestFormat ($format)
 
 getContentType ()
 
 setDefaultLocale ($locale)
 
 getDefaultLocale ()
 
 setLocale ($locale)
 
 getLocale ()
 
 isMethod ($method)
 
 isMethodSafe ()
 
 isMethodCacheable ()
 
 getContent ($asResource=false)
 
 getETags ()
 
 isNoCache ()
 
 getPreferredLanguage (array $locales=null)
 
 getLanguages ()
 
 getCharsets ()
 
 getEncodings ()
 
 getAcceptableContentTypes ()
 
 isXmlHttpRequest ()
 

Static Public Member Functions

static createFromGlobals ()
 
static create ($uri, $method='GET', $parameters=array(), $cookies=array(), $files=array(), $server=array(), $content=null)
 
static setFactory ($callable)
 
static setTrustedProxies (array $proxies)
 
static getTrustedProxies ()
 
static setTrustedHosts (array $hostPatterns)
 
static getTrustedHosts ()
 
static setTrustedHeaderName ($key, $value)
 
static getTrustedHeaderName ($key)
 
static normalizeQueryString ($qs)
 
static enableHttpMethodParameterOverride ()
 
static getHttpMethodParameterOverride ()
 

Data Fields

const HEADER_FORWARDED = 'forwarded'
 
const HEADER_CLIENT_IP = 'client_ip'
 
const HEADER_CLIENT_HOST = 'client_host'
 
const HEADER_CLIENT_PROTO = 'client_proto'
 
const HEADER_CLIENT_PORT = 'client_port'
 
const METHOD_HEAD = 'HEAD'
 
const METHOD_GET = 'GET'
 
const METHOD_POST = 'POST'
 
const METHOD_PUT = 'PUT'
 
const METHOD_PATCH = 'PATCH'
 
const METHOD_DELETE = 'DELETE'
 
const METHOD_PURGE = 'PURGE'
 
const METHOD_OPTIONS = 'OPTIONS'
 
const METHOD_TRACE = 'TRACE'
 
const METHOD_CONNECT = 'CONNECT'
 
 $attributes
 
 $request
 
 $query
 
 $server
 
 $files
 
 $cookies
 
 $headers
 

Protected Member Functions

 prepareRequestUri ()
 
 prepareBaseUrl ()
 
 prepareBasePath ()
 
 preparePathInfo ()
 

Static Protected Member Functions

static initializeFormats ()
 

Protected Attributes

 $content
 
 $languages
 
 $charsets
 
 $encodings
 
 $acceptableContentTypes
 
 $pathInfo
 
 $requestUri
 
 $baseUrl
 
 $basePath
 
 $method
 
 $format
 
 $session
 
 $locale
 
 $defaultLocale = 'en'
 

Static Protected Attributes

static $trustedProxies = array()
 
static $trustedHostPatterns = array()
 
static $trustedHosts = array()
 
static $trustedHeaders
 
static $httpMethodParameterOverride = false
 
static $formats
 
static $requestFactory
 

Detailed Description

Request represents an HTTP request.

The methods dealing with URL accept / return a raw path (% encoded):

  • getBasePath
  • getBaseUrl
  • getPathInfo
  • getRequestUri
  • getUri
  • getUriForPath
Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 30 of file Request.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $query = array(),
array  $request = array(),
array  $attributes = array(),
array  $cookies = array(),
array  $files = array(),
array  $server = array(),
  $content = null 
)

Constructor.

Parameters
array$queryThe GET parameters
array$requestThe POST parameters
array$attributesThe request attributes (parameters parsed from the PATH_INFO, ...)
array$cookiesThe COOKIE parameters
array$filesThe FILES parameters
array$serverThe SERVER parameters
string | resource$contentThe raw body data

Definition at line 220 of file Request.php.

Member Function Documentation

◆ __clone()

__clone ( )

Clones the current request.

Note that the session is not cloned as duplicated requests are most of the time sub-requests of the main one.

Definition at line 477 of file Request.php.

◆ __toString()

__toString ( )

Returns the request as a string.

Returns
string The request

Definition at line 493 of file Request.php.

◆ create()

static create (   $uri,
  $method = 'GET',
  $parameters = array(),
  $cookies = array(),
  $files = array(),
  $server = array(),
  $content = null 
)
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$uriThe URI
string$methodThe HTTP method
array$parametersThe query (GET) or request (POST) parameters
array$cookiesThe request cookies ($_COOKIE)
array$filesThe request files ($_FILES)
array$serverThe server parameters ($_SERVER)
string$contentThe raw body data
Returns
static

Definition at line 309 of file Request.php.

◆ createFromGlobals()

static createFromGlobals ( )
static

Creates a new request with values from PHP's super globals.

Returns
static

Definition at line 266 of file Request.php.

◆ duplicate()

duplicate ( array  $query = null,
array  $request = null,
array  $attributes = null,
array  $cookies = null,
array  $files = null,
array  $server = null 
)

Clones a request and overrides some of its parameters.

Parameters
array$queryThe GET parameters
array$requestThe POST parameters
array$attributesThe request attributes (parameters parsed from the PATH_INFO, ...)
array$cookiesThe COOKIE parameters
array$filesThe FILES parameters
array$serverThe SERVER parameters
Returns
static

Definition at line 427 of file Request.php.

◆ enableHttpMethodParameterOverride()

static enableHttpMethodParameterOverride ( )
static

Enables support for the _method request parameter to determine the intended HTTP method.

Be warned that enabling this feature might lead to CSRF issues in your code. Check that you are using CSRF tokens when required. If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered and used to send a "PUT" or "DELETE" request via the _method request parameter. If these methods are not protected against CSRF, this presents a possible vulnerability.

The HTTP method can only be overridden when the real HTTP method is POST.

Definition at line 689 of file Request.php.

◆ get()

get (   $key,
  $default = null,
  $deep = false 
)

Gets a "parameter" value.

This method is mainly useful for libraries that want to provide some flexibility.

Order of precedence: GET, PATH, POST

Avoid using this method in controllers:

  • slow
  • prefer to get from a "named" source

It is better to explicitly get request parameters from the appropriate public property instead (query, attributes, request).

Note: Finding deep items is deprecated since version 2.8, to be removed in 3.0.

Parameters
string$keythe key
mixed$defaultthe default value if the parameter key does not exist
bool$deepis parameter deep in multidimensional array
Returns
mixed

Definition at line 727 of file Request.php.

◆ getAcceptableContentTypes()

getAcceptableContentTypes ( )

Gets a list of content types acceptable by the client browser.

Returns
array List of content types in preferable order

Definition at line 1675 of file Request.php.

◆ getBasePath()

getBasePath ( )

Returns the root path from which this request is executed.

Suppose that an index.php file instantiates this request object:

Returns
string The raw path (i.e. not urldecoded)

Definition at line 916 of file Request.php.

◆ getBaseUrl()

getBaseUrl ( )

Returns the root URL from which this request is executed.

The base URL never ends with a /.

This is similar to getBasePath(), except that it also includes the script filename (e.g. index.php) if one exists.

Returns
string The raw URL (i.e. not urldecoded)

Definition at line 935 of file Request.php.

◆ getCharsets()

getCharsets ( )

Gets a list of charsets acceptable by the client browser.

Returns
array List of charsets in preferable order

Definition at line 1647 of file Request.php.

◆ getClientIp()

getClientIp ( )

Returns the client IP address.

This method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" header value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from.

If your reverse proxy uses a different header name than "X-Forwarded-For", ("Client-Ip" for instance), configure it via "setTrustedHeaderName()" with the "client-ip" key.

Returns
string The client IP address
See also
getClientIps()
http://en.wikipedia.org/wiki/X-Forwarded-For

Definition at line 864 of file Request.php.

◆ getClientIps()

getClientIps ( )

Returns the client IP addresses.

In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped.

Use this method carefully; you should use getClientIp() instead.

Returns
array The client IP addresses
See also
getClientIp()

Definition at line 807 of file Request.php.

◆ getContent()

getContent (   $asResource = false)

Returns the request body content.

Parameters
bool$asResourceIf true, a resource will be returned
Returns
string|resource The request body content or a resource to read the body stream
Exceptions

Definition at line 1508 of file Request.php.

◆ getContentType()

getContentType ( )

Gets the format associated with the request.

Returns
string|null The format (null if no content type is present)

Definition at line 1412 of file Request.php.

◆ getDefaultLocale()

getDefaultLocale ( )

Get the default locale.

Returns
string

Definition at line 1436 of file Request.php.

◆ getEncodings()

getEncodings ( )

Gets a list of encodings acceptable by the client browser.

Returns
array List of encodings in preferable order

Definition at line 1661 of file Request.php.

◆ getETags()

getETags ( )

Gets the Etags.

Returns
array The entity tags

Definition at line 1554 of file Request.php.

◆ getFormat()

getFormat (   $mimeType)

Gets the format associated with the mime type.

Parameters
string$mimeTypeThe associated mime type
Returns
string|null The format (null if not found)

Definition at line 1339 of file Request.php.

◆ getHost()

getHost ( )

Returns the host name.

This method can read the client host name from the "X-Forwarded-Host" header when trusted proxies were set via "setTrustedProxies()".

The "X-Forwarded-Host" header must contain the client host name.

If your reverse proxy uses a different header name than "X-Forwarded-Host", configure it via "setTrustedHeaderName()" with the "client-host" key.

Returns
string
Exceptions

Definition at line 1217 of file Request.php.

◆ getHttpHost()

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 1040 of file Request.php.

◆ getHttpMethodParameterOverride()

static getHttpMethodParameterOverride ( )
static

Checks whether support for the _method request parameter is enabled.

Returns
bool True when the _method request parameter is enabled, false otherwise

Definition at line 699 of file Request.php.

◆ getLanguages()

getLanguages ( )

Gets a list of languages acceptable by the client browser.

Returns
array Languages ordered in the user browser preferences

Definition at line 1607 of file Request.php.

◆ getLocale()

getLocale ( )

Get the locale.

Returns
string

Definition at line 1456 of file Request.php.

◆ getMethod()

getMethod ( )

Gets the request "intended" method.

If the X-HTTP-Method-Override header is set, and if the method is a POST, then it is used to determine the "real" intended HTTP method.

The _method request parameter can also be used to determine the HTTP method, but only if enableHttpMethodParameterOverride() has been called.

The method is always an uppercased string.

Returns
string The request method
See also
getRealMethod()

Definition at line 1287 of file Request.php.

◆ getMimeType()

getMimeType (   $format)

Gets the mime type associated with the format.

Parameters
string$formatThe format
Returns
string The associated mime type (null if not found)

Definition at line 1323 of file Request.php.

◆ getPassword()

getPassword ( )

Returns the password.

Returns
string|null

Definition at line 1011 of file Request.php.

◆ getPathInfo()

getPathInfo ( )

Returns the path being requested relative to the executed script.

The path info always starts with a /.

Suppose this request is instantiated from /mysite on localhost:

Returns
string The raw path (i.e. not urldecoded)

Definition at line 895 of file Request.php.

◆ getPort()

getPort ( )

Returns the port on which the request is made.

This method can read the client port from the "X-Forwarded-Port" header when trusted proxies were set via "setTrustedProxies()".

The "X-Forwarded-Port" header must contain the client port.

If your reverse proxy uses a different header name than "X-Forwarded-Port", configure it via "setTrustedHeaderName()" with the "client-port" key.

Returns
string

Definition at line 967 of file Request.php.

◆ getPreferredLanguage()

getPreferredLanguage ( array  $locales = null)

Returns the preferred language.

Parameters
array$localesAn array of ordered available locales
Returns
string|null The preferred locale

Definition at line 1574 of file Request.php.

◆ getQueryString()

getQueryString ( )

Generates 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 1170 of file Request.php.

◆ getRealMethod()

getRealMethod ( )

Gets the "real" request method.

Returns
string The request method
See also
getMethod()

Definition at line 1311 of file Request.php.

◆ getRelativeUriForPath()

getRelativeUriForPath (   $path)

Returns the path as relative reference from the current Request path.

Only the URIs path component (no schema, host etc.) is relevant and must be given. Both paths must be absolute and not contain relative parts. Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. Furthermore, they can be used to reduce the link size in documents.

Example target paths, given a base path of "/a/b/c/d":

  • "/a/b/c/d" -> ""
  • "/a/b/c/" -> "./"
  • "/a/b/" -> "../"
  • "/a/b/c/other" -> "other"
  • "/a/x/y" -> "../../x/y"
Parameters
string$pathThe target path
Returns
string The relative target path

Definition at line 1126 of file Request.php.

◆ getRequestFormat()

getRequestFormat (   $default = 'html')

Gets the request format.

Here is the process to determine the format:

Parameters
string$defaultThe default format
Returns
string The request format

Definition at line 1388 of file Request.php.

◆ getRequestUri()

getRequestUri ( )

Returns the requested URI (path and query string).

Returns
string The raw URI (i.e. not URI decoded)

Definition at line 1057 of file Request.php.

◆ getScheme()

getScheme ( )

Gets the request's scheme.

Returns
string

Definition at line 949 of file Request.php.

◆ getSchemeAndHttpHost()

getSchemeAndHttpHost ( )

Gets the scheme and HTTP host.

If the URL was called with basic authentication, the user and the password are not added to the generated string.

Returns
string The scheme and HTTP host

Definition at line 1074 of file Request.php.

◆ getScriptName()

getScriptName ( )

Returns current script name.

Returns
string

Definition at line 876 of file Request.php.

◆ getSession()

getSession ( )

Gets the Session.

Returns
SessionInterface|null The session

Definition at line 753 of file Request.php.

◆ getTrustedHeaderName()

static getTrustedHeaderName (   $key)
static

Gets the trusted proxy header name.

Parameters
string$keyThe header key
Returns
string The header name
Exceptions

Definition at line 626 of file Request.php.

◆ getTrustedHosts()

static getTrustedHosts ( )
static

Gets the list of trusted host patterns.

Returns
array An array of trusted host patterns

Definition at line 585 of file Request.php.

◆ getTrustedProxies()

static getTrustedProxies ( )
static

Gets the list of trusted proxies.

Returns
array An array of trusted proxies

Definition at line 559 of file Request.php.

◆ getUri()

getUri ( )

Generates a normalized URI (URL) for the Request.

Returns
string A normalized URI (URL) for the Request
See also
getQueryString()

Definition at line 1086 of file Request.php.

◆ getUriForPath()

getUriForPath (   $path)

Generates a normalized URI for the given path.

Parameters
string$pathA path to use instead of the current one
Returns
string The normalized URI for the path

Definition at line 1102 of file Request.php.

◆ getUser()

getUser ( )

Returns the user.

Returns
string|null

Definition at line 1001 of file Request.php.

◆ getUserInfo()

getUserInfo ( )

Gets the user info.

Returns
string A user name and, optionally, scheme-specific information about how to gain authorization to access the server

Definition at line 1021 of file Request.php.

◆ hasPreviousSession()

hasPreviousSession ( )

Whether the request contains a Session which was started in one of the previous requests.

Returns
bool

Definition at line 764 of file Request.php.

◆ hasSession()

hasSession ( )

Whether the request contains a Session object.

This method does not give any information about the state of the session object, like whether the session is started or not. It is just a way to check if this Request is associated with a Session instance.

Returns
bool true when the Request contains a Session object, false otherwise

Definition at line 779 of file Request.php.

◆ initialize()

initialize ( array  $query = array(),
array  $request = array(),
array  $attributes = array(),
array  $cookies = array(),
array  $files = array(),
array  $server = array(),
  $content = null 
)

Sets the parameters for this request.

This method also re-initializes all properties.

Parameters
array$queryThe GET parameters
array$requestThe POST parameters
array$attributesThe request attributes (parameters parsed from the PATH_INFO, ...)
array$cookiesThe COOKIE parameters
array$filesThe FILES parameters
array$serverThe SERVER parameters
string | resource$contentThe raw body data

Definition at line 238 of file Request.php.

◆ initializeFormats()

static initializeFormats ( )
staticprotected

Initializes HTTP request formats.

Definition at line 1873 of file Request.php.

◆ isMethod()

isMethod (   $method)

Checks if the request method is of specified type.

Parameters
string$methodUppercase request method (GET, POST etc)
Returns
bool

Definition at line 1468 of file Request.php.

◆ isMethodCacheable()

isMethodCacheable ( )

Checks whether the method is cacheable or not.

See also
https://tools.ietf.org/html/rfc7231#section-4.2.3
Returns
bool

Definition at line 1494 of file Request.php.

◆ isMethodSafe()

isMethodSafe ( )

Checks whether the method is safe or not.

See also
https://tools.ietf.org/html/rfc7231#section-4.2.1
Parameters
bool$andCacheableAdds the additional condition that the method should be cacheable. True by default.
Returns
bool

Definition at line 1482 of file Request.php.

◆ isNoCache()

isNoCache ( )
Returns
bool

Definition at line 1562 of file Request.php.

◆ isSecure()

isSecure ( )

Checks whether the request is secure or not.

This method can read the client protocol from the "X-Forwarded-Proto" header when trusted proxies were set via "setTrustedProxies()".

The "X-Forwarded-Proto" header must contain the protocol: "https" or "http".

If your reverse proxy uses a different header name than "X-Forwarded-Proto" ("SSL_HTTPS" for instance), configure it via "setTrustedHeaderName()" with the "client-proto" key.

Returns
bool

Definition at line 1191 of file Request.php.

◆ isXmlHttpRequest()

isXmlHttpRequest ( )

Returns true if the request is a XMLHttpRequest.

It works if your JavaScript library sets an X-Requested-With HTTP header. It is known to work with common JavaScript frameworks:

See also
http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript
Returns
bool true if the request is an XMLHttpRequest, false otherwise

Definition at line 1694 of file Request.php.

◆ normalizeQueryString()

static 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
string$qsQuery string
Returns
string A normalized query string for the Request

Definition at line 645 of file Request.php.

◆ overrideGlobals()

overrideGlobals ( )

Overrides the PHP global variables according to this request instance.

It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. $_FILES is never overridden, see rfc1867

Definition at line 513 of file Request.php.

◆ prepareBasePath()

prepareBasePath ( )
protected

Prepares the base path.

Returns
string base path

Definition at line 1820 of file Request.php.

◆ prepareBaseUrl()

prepareBaseUrl ( )
protected

Prepares the base URL.

Returns
string

Definition at line 1754 of file Request.php.

◆ preparePathInfo()

preparePathInfo ( )
protected

Prepares the path info.

Returns
string path info

Definition at line 1846 of file Request.php.

◆ prepareRequestUri()

prepareRequestUri ( )
protected

Definition at line 1707 of file Request.php.

◆ setDefaultLocale()

setDefaultLocale (   $locale)

Sets the default locale.

Parameters
string$locale

Definition at line 1422 of file Request.php.

◆ setFactory()

static setFactory (   $callable)
static

Sets a callable able to create a Request instance.

This is mainly useful when you need to override the Request class to keep BC with an existing system. It should not be used for any other purpose.

Parameters
callable | null$callableA PHP callable

Definition at line 410 of file Request.php.

◆ setFormat()

setFormat (   $format,
  $mimeTypes 
)

Associates a format with mime types.

Parameters
string$formatThe format
string | array$mimeTypesThe associated mime types (the preferred one must be the first as it will be used as the content type)

Definition at line 1366 of file Request.php.

◆ setLocale()

setLocale (   $locale)

Sets the locale.

Parameters
string$locale

Definition at line 1446 of file Request.php.

◆ setMethod()

setMethod (   $method)

Sets the request method.

Parameters
string$method

Definition at line 1266 of file Request.php.

◆ setRequestFormat()

setRequestFormat (   $format)

Sets the request format.

Parameters
string$formatThe request format

Definition at line 1402 of file Request.php.

◆ setSession()

setSession ( SessionInterface  $session)

Sets the Session.

Parameters
SessionInterface$sessionThe Session

Definition at line 789 of file Request.php.

◆ setTrustedHeaderName()

static setTrustedHeaderName (   $key,
  $value 
)
static

Sets the name for trusted headers.

The following header keys are supported:

Setting an empty value allows to disable the trusted header for the given key.

Parameters
string$keyThe header key
string$valueThe header name
Exceptions

Definition at line 608 of file Request.php.

◆ setTrustedHosts()

static setTrustedHosts ( array  $hostPatterns)
static

Sets a list of trusted host patterns.

You should only list the hosts you manage using regexs.

Parameters
array$hostPatternsA list of trusted host patterns

Definition at line 571 of file Request.php.

◆ setTrustedProxies()

static setTrustedProxies ( array  $proxies)
static

Sets a list of trusted proxies.

You should only list the reverse proxies that you manage directly.

Parameters
array$proxiesA list of trusted proxies

Definition at line 549 of file Request.php.

Field Documentation

◆ $acceptableContentTypes

$acceptableContentTypes
protected

Definition at line 155 of file Request.php.

◆ $attributes

Definition at line 88 of file Request.php.

◆ $basePath

$basePath
protected

Definition at line 175 of file Request.php.

◆ $baseUrl

$baseUrl
protected

Definition at line 170 of file Request.php.

◆ $charsets

$charsets
protected

Definition at line 145 of file Request.php.

◆ $content

$content
protected

Definition at line 135 of file Request.php.

◆ $cookies

$cookies

Definition at line 123 of file Request.php.

◆ $defaultLocale

$defaultLocale = 'en'
protected

Definition at line 200 of file Request.php.

◆ $encodings

$encodings
protected

Definition at line 150 of file Request.php.

◆ $files

$files

Definition at line 116 of file Request.php.

◆ $format

$format
protected

Definition at line 185 of file Request.php.

◆ $formats

$formats
staticprotected

Definition at line 205 of file Request.php.

◆ $headers

$headers

Definition at line 130 of file Request.php.

◆ $httpMethodParameterOverride

$httpMethodParameterOverride = false
staticprotected

Definition at line 81 of file Request.php.

◆ $languages

$languages
protected

Definition at line 140 of file Request.php.

◆ $locale

$locale
protected

Definition at line 195 of file Request.php.

◆ $method

$method
protected

Definition at line 180 of file Request.php.

◆ $pathInfo

$pathInfo
protected

Definition at line 160 of file Request.php.

◆ $query

$query

Definition at line 102 of file Request.php.

◆ $request

$request

Definition at line 95 of file Request.php.

◆ $requestFactory

$requestFactory
staticprotected

Definition at line 207 of file Request.php.

◆ $requestUri

$requestUri
protected

Definition at line 165 of file Request.php.

◆ $server

$server

Definition at line 109 of file Request.php.

◆ $session

$session
protected

Definition at line 190 of file Request.php.

◆ $trustedHeaders

$trustedHeaders
staticprotected
Initial value:
= array(
self::HEADER_FORWARDED => 'FORWARDED',
self::HEADER_CLIENT_IP => 'X_FORWARDED_FOR',
self::HEADER_CLIENT_HOST => 'X_FORWARDED_HOST',
self::HEADER_CLIENT_PROTO => 'X_FORWARDED_PROTO',
self::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT',
)

Names for headers that can be trusted when using trusted proxies.

The FORWARDED header is the standard as of rfc7239.

The other headers are non-standard, but widely used by popular reverse proxies (like Apache mod_proxy or Amazon EC2).

Definition at line 73 of file Request.php.

◆ $trustedHostPatterns

$trustedHostPatterns = array()
staticprotected

Definition at line 57 of file Request.php.

◆ $trustedHosts

$trustedHosts = array()
staticprotected

Definition at line 62 of file Request.php.

◆ $trustedProxies

$trustedProxies = array()
staticprotected

Definition at line 52 of file Request.php.

◆ HEADER_CLIENT_HOST

const HEADER_CLIENT_HOST = 'client_host'

Definition at line 34 of file Request.php.

◆ HEADER_CLIENT_IP

const HEADER_CLIENT_IP = 'client_ip'

Definition at line 33 of file Request.php.

◆ HEADER_CLIENT_PORT

const HEADER_CLIENT_PORT = 'client_port'

Definition at line 36 of file Request.php.

◆ HEADER_CLIENT_PROTO

const HEADER_CLIENT_PROTO = 'client_proto'

Definition at line 35 of file Request.php.

◆ HEADER_FORWARDED

const HEADER_FORWARDED = 'forwarded'

Definition at line 32 of file Request.php.

◆ METHOD_CONNECT

const METHOD_CONNECT = 'CONNECT'

Definition at line 47 of file Request.php.

◆ METHOD_DELETE

const METHOD_DELETE = 'DELETE'

Definition at line 43 of file Request.php.

◆ METHOD_GET

const METHOD_GET = 'GET'

Definition at line 39 of file Request.php.

◆ METHOD_HEAD

const METHOD_HEAD = 'HEAD'

Definition at line 38 of file Request.php.

◆ METHOD_OPTIONS

const METHOD_OPTIONS = 'OPTIONS'

Definition at line 45 of file Request.php.

◆ METHOD_PATCH

const METHOD_PATCH = 'PATCH'

Definition at line 42 of file Request.php.

◆ METHOD_POST

const METHOD_POST = 'POST'

Definition at line 40 of file Request.php.

◆ METHOD_PURGE

const METHOD_PURGE = 'PURGE'

Definition at line 44 of file Request.php.

◆ METHOD_PUT

const METHOD_PUT = 'PUT'

Definition at line 41 of file Request.php.

◆ METHOD_TRACE

const METHOD_TRACE = 'TRACE'

Definition at line 46 of file Request.php.


The documentation for this class was generated from the following file: