Свойство | Type | Description | |
---|---|---|---|
$attributes | Symfony\Component\HttpFoundation\ParameterBag | Custom parameters. | |
$cookies | Symfony\Component\HttpFoundation\ParameterBag | Cookies ($_COOKIE). | |
$files | Uploaded files ($_FILES). | ||
$headers | Headers (taken from the $_SERVER). | ||
$query | Symfony\Component\HttpFoundation\ParameterBag | Query string parameters ($_GET). | |
$request | Symfony\Component\HttpFoundation\ParameterBag | Request body parameters ($_POST). | |
$server | Server and execution environment parameters ($_SERVER). |
Свойство | Type | Description | |
---|---|---|---|
$acceptableContentTypes | array | ||
$basePath | string | ||
$baseUrl | string | ||
$charsets | array | ||
$content | string | ||
$defaultLocale | string | ||
$encodings | array | ||
$format | string | ||
$formats | array | ||
$httpMethodParameterOverride | |||
$languages | array | ||
$locale | string | ||
$method | string | ||
$pathInfo | string | ||
$requestFactory | |||
$requestUri | string | ||
$session | Symfony\Component\HttpFoundation\Session\SessionInterface | ||
$trustedHeaders | 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). | ||
$trustedHostPatterns | string[] | ||
$trustedHosts | string[] | ||
$trustedProxies | string[] |
Méthode | Description | |
---|---|---|
__clone ( ) | Clones the current request. | |
__construct ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string | resource $content = null ) | Constructor. | |
__toString ( ) : string | Returns the request as a string. | |
create ( string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], string $content = null ) : |
Creates a Request based on a given URI and configuration. | |
createFromGlobals ( ) : |
Creates a new request with values from PHP's super globals. | |
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. | |
enableHttpMethodParameterOverride ( ) | Enables support for the _method request parameter to determine the intended HTTP method. | |
get ( string $key, mixed $default = null ) : mixed | Gets a "parameter" value from any bag. | |
getAcceptableContentTypes ( ) : array | Gets a list of content types acceptable by the client browser. | |
getBasePath ( ) : string | Returns the root path from which this request is executed. | |
getBaseUrl ( ) : string | Returns the root URL from which this request is executed. | |
getCharsets ( ) : array | Gets a list of charsets acceptable by the client browser. | |
getClientIp ( ) : string | Returns the client IP address. | |
getClientIps ( ) : array | Returns the client IP addresses. | |
getContent ( boolean $asResource = false ) : string | resource | Returns the request body content. | |
getContentType ( ) : string | null | Gets the format associated with the request. | |
getDefaultLocale ( ) : string | Get the default locale. | |
getETags ( ) : array | Gets the Etags. | |
getEncodings ( ) : array | Gets a list of encodings acceptable by the client browser. | |
getFormat ( string $mimeType ) : string | null | Gets the format associated with the mime type. | |
getHost ( ) : string | Returns the host name. | |
getHttpHost ( ) : string | Returns the HTTP host being requested. | |
getHttpMethodParameterOverride ( ) : boolean | Checks whether support for the _method request parameter is enabled. | |
getLanguages ( ) : array | Gets a list of languages acceptable by the client browser. | |
getLocale ( ) : string | Get the locale. | |
getMethod ( ) : string | Gets the request "intended" method. | |
getMimeType ( string $format ) : string | Gets the mime type associated with the format. | |
getMimeTypes ( string $format ) : array | Gets the mime types associated with the format. | |
getPassword ( ) : string | null | Returns the password. | |
getPathInfo ( ) : string | Returns the path being requested relative to the executed script. | |
getPort ( ) : string | Returns the port on which the request is made. | |
getPreferredLanguage ( array $locales = null ) : string | null | Returns the preferred language. | |
getQueryString ( ) : string | null | Generates the normalized query string for the Request. | |
getRealMethod ( ) : string | Gets the "real" request method. | |
getRelativeUriForPath ( string $path ) : string | Returns the path as relative reference from the current Request path. | |
getRequestFormat ( string $default = 'html' ) : string | Gets the request format. | |
getRequestUri ( ) : string | Returns the requested URI (path and query string). | |
getScheme ( ) : string | Gets the request's scheme. | |
getSchemeAndHttpHost ( ) : string | Gets the scheme and HTTP host. | |
getScriptName ( ) : string | Returns current script name. | |
getSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface | null | Gets the Session. | |
getTrustedHeaderName ( string $key ) : string | Gets the trusted proxy header name. | |
getTrustedHosts ( ) : array | Gets the list of trusted host patterns. | |
getTrustedProxies ( ) : array | Gets the list of trusted proxies. | |
getUri ( ) : string | Generates a normalized URI (URL) for the Request. | |
getUriForPath ( string $path ) : string | Generates a normalized URI for the given path. | |
getUser ( ) : string | null | Returns the user. | |
getUserInfo ( ) : string | Gets the user info. | |
hasPreviousSession ( ) : boolean | Whether the request contains a Session which was started in one of the previous requests. | |
hasSession ( ) : boolean | Whether the request contains a Session object. | |
initialize ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string | resource $content = null ) | Sets the parameters for this request. | |
isFromTrustedProxy ( ) : boolean | Indicates whether this request originated from a trusted proxy. | |
isMethod ( string $method ) : boolean | Checks if the request method is of specified type. | |
isMethodCacheable ( ) : boolean | Checks whether the method is cacheable or not. | |
isMethodIdempotent ( ) : boolean | Checks whether or not the method is idempotent. | |
isMethodSafe ( ) : boolean | Checks whether or not the method is safe. | |
isNoCache ( ) : boolean | ||
isSecure ( ) : boolean | Checks whether the request is secure or not. | |
isXmlHttpRequest ( ) : boolean | Returns true if the request is a XMLHttpRequest. | |
normalizeQueryString ( string $qs ) : string | Normalizes a query string. | |
overrideGlobals ( ) | Overrides the PHP global variables according to this request instance. | |
setDefaultLocale ( string $locale ) | Sets the default locale. | |
setFactory ( callable | null $callable ) | Sets a callable able to create a Request instance. | |
setFormat ( string $format, string | array $mimeTypes ) | Associates a format with mime types. | |
setLocale ( string $locale ) | Sets the locale. | |
setMethod ( string $method ) | Sets the request method. | |
setRequestFormat ( string $format ) | Sets the request format. | |
setSession ( Symfony\Component\HttpFoundation\Session\SessionInterface $session ) | Sets the Session. | |
setTrustedHeaderName ( string $key, string $value ) | Sets the name for trusted headers. | |
setTrustedHosts ( array $hostPatterns ) | Sets a list of trusted host patterns. | |
setTrustedProxies ( array $proxies ) | Sets a list of trusted proxies. |
Méthode | Description | |
---|---|---|
initializeFormats ( ) | Initializes HTTP request formats. | |
prepareBasePath ( ) : string | Prepares the base path. | |
prepareBaseUrl ( ) : string | Prepares the base URL. | |
preparePathInfo ( ) : string | Prepares the path info. | |
prepareRequestUri ( ) | * The following methods are derived from code of the Zend Framework (1.10dev - 2010-01-24) |
Méthode | Description | |
---|---|---|
createRequestFromFactory ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null ) | ||
getUrlencodedPrefix ( $string, $prefix ) | * Returns the prefix as encoded in the string when the string starts with the given prefix, false otherwise. | |
normalizeAndFilterClientIps ( array $clientIps, $ip ) | ||
setPhpDefaultLocale ( string $locale ) | Sets the default PHP locale. |
public __clone ( ) |
public __construct ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string | resource $content = null ) | ||
$query | array | The GET parameters |
$request | array | The POST parameters |
$attributes | array | The request attributes (parameters parsed from the PATH_INFO, ...) |
$cookies | array | The COOKIE parameters |
$files | array | The FILES parameters |
$server | array | The SERVER parameters |
$content | string | resource | The raw body data |
public __toString ( ) : string | ||
Résultat | string | The request |
public static create ( string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], string $content = null ) : |
||
$uri | string | The URI |
$method | string | The HTTP method |
$parameters | array | The query (GET) or request (POST) parameters |
$cookies | array | The request cookies ($_COOKIE) |
$files | array | The request files ($_FILES) |
$server | array | The server parameters ($_SERVER) |
$content | string | The raw body data |
Résultat | A Request instance |
public static createFromGlobals ( ) : |
||
Résultat | A new request |
public duplicate ( array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null ) : |
||
$query | array | The GET parameters |
$request | array | The POST parameters |
$attributes | array | The request attributes (parameters parsed from the PATH_INFO, ...) |
$cookies | array | The COOKIE parameters |
$files | array | The FILES parameters |
$server | array | The SERVER parameters |
Résultat | The duplicated request |
public static enableHttpMethodParameterOverride ( ) |
public getAcceptableContentTypes ( ) : array | ||
Résultat | array | List of content types in preferable order |
public getBasePath ( ) : string | ||
Résultat | string | The raw path (i.e. not urldecoded) |
public getBaseUrl ( ) : string | ||
Résultat | string | The raw URL (i.e. not urldecoded) |
public getCharsets ( ) : array | ||
Résultat | array | List of charsets in preferable order |
public getClientIp ( ) : string | ||
Résultat | string | The client IP address |
public getClientIps ( ) : array | ||
Résultat | array | The client IP addresses |
public getContent ( boolean $asResource = false ) : string | resource | ||
$asResource | boolean | If true, a resource will be returned |
Résultat | string | resource | The request body content or a resource to read the body stream |
public getContentType ( ) : string | null | ||
Résultat | string | null | The format (null if no content type is present) |
public getDefaultLocale ( ) : string | ||
Résultat | string |
public getEncodings ( ) : array | ||
Résultat | array | List of encodings in preferable order |
public getHttpHost ( ) : string | ||
Résultat | string |
public static getHttpMethodParameterOverride ( ) : boolean | ||
Résultat | boolean | True when the _method request parameter is enabled, false otherwise |
public getLanguages ( ) : array | ||
Résultat | array | Languages ordered in the user browser preferences |
public getMimeType ( string $format ) : string | ||
$format | string | The format |
Résultat | string | The associated mime type (null if not found) |
public static getMimeTypes ( string $format ) : array | ||
$format | string | The format |
Résultat | array | The associated mime types |
public getPassword ( ) : string | null | ||
Résultat | string | null |
public getPathInfo ( ) : string | ||
Résultat | string | The raw path (i.e. not urldecoded) |
public getQueryString ( ) : string | null | ||
Résultat | string | null | A normalized query string for the Request |
public getRealMethod ( ) : string | ||
Résultat | string | The request method |
public getRelativeUriForPath ( string $path ) : string | ||
$path | string | The target path |
Résultat | string | The relative target path |
public getRequestFormat ( string $default = 'html' ) : string | ||
$default | string | The default format |
Résultat | string | The request format |
public getRequestUri ( ) : string | ||
Résultat | string | The raw URI (i.e. not URI decoded) |
public getSchemeAndHttpHost ( ) : string | ||
Résultat | string | The scheme and HTTP host |
public getScriptName ( ) : string | ||
Résultat | string |
public getSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface | null | ||
Résultat | Symfony\Component\HttpFoundation\Session\SessionInterface | null | The session |
public static getTrustedHeaderName ( string $key ) : string | ||
$key | string | The header key |
Résultat | string | The header name |
public static getTrustedHosts ( ) : array | ||
Résultat | array | An array of trusted host patterns |
public static getTrustedProxies ( ) : array | ||
Résultat | array | An array of trusted proxies |
public getUriForPath ( string $path ) : string | ||
$path | string | A path to use instead of the current one |
Résultat | string | The normalized URI for the path |
public getUserInfo ( ) : string | ||
Résultat | string | A user name and, optionally, scheme-specific information about how to gain authorization to access the server |
public hasPreviousSession ( ) : boolean | ||
Résultat | boolean |
public hasSession ( ) : boolean | ||
Résultat | boolean | true when the Request contains a Session object, false otherwise |
public initialize ( array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], string | resource $content = null ) | ||
$query | array | The GET parameters |
$request | array | The POST parameters |
$attributes | array | The request attributes (parameters parsed from the PATH_INFO, ...) |
$cookies | array | The COOKIE parameters |
$files | array | The FILES parameters |
$server | array | The SERVER parameters |
$content | string | resource | The raw body data |
protected static initializeFormats ( ) |
public isFromTrustedProxy ( ) : boolean | ||
Résultat | boolean | true if the request came from a trusted proxy, false otherwise |
public isMethodCacheable ( ) : boolean | ||
Résultat | boolean |
public isMethodIdempotent ( ) : boolean | ||
Résultat | boolean |
public isMethodSafe ( ) : boolean | ||
Résultat | boolean |
public isXmlHttpRequest ( ) : boolean | ||
Résultat | boolean | true if the request is an XMLHttpRequest, false otherwise |
public static normalizeQueryString ( string $qs ) : string | ||
$qs | string | Query string |
Résultat | string | A normalized query string for the Request |
public overrideGlobals ( ) |
protected prepareBasePath ( ) : string | ||
Résultat | string | base path |
protected prepareBaseUrl ( ) : string | ||
Résultat | string |
protected preparePathInfo ( ) : string | ||
Résultat | string | path info |
protected prepareRequestUri ( ) |
public setDefaultLocale ( string $locale ) | ||
$locale | string |
public static setFactory ( callable | null $callable ) | ||
$callable | callable | null | A PHP callable |
public setRequestFormat ( string $format ) | ||
$format | string | The request format |
public setSession ( Symfony\Component\HttpFoundation\Session\SessionInterface $session ) | ||
$session | Symfony\Component\HttpFoundation\Session\SessionInterface | The Session |
public static setTrustedHeaderName ( string $key, string $value ) | ||
$key | string | The header key |
$value | string | The header name |
public static setTrustedHosts ( array $hostPatterns ) | ||
$hostPatterns | array | A list of trusted host patterns |
public static setTrustedProxies ( array $proxies ) | ||
$proxies | array | A list of trusted proxies |
protected array $acceptableContentTypes | ||
Résultat | array |
public ParameterBag,Symfony\Component\HttpFoundation $attributes | ||
Résultat | Symfony\Component\HttpFoundation\ParameterBag |
public ParameterBag,Symfony\Component\HttpFoundation $cookies | ||
Résultat | Symfony\Component\HttpFoundation\ParameterBag |
public FileBag,Symfony\Component\HttpFoundation $files | ||
Résultat |
public HeaderBag,Symfony\Component\HttpFoundation $headers | ||
Résultat |
protected static $httpMethodParameterOverride |
public ParameterBag,Symfony\Component\HttpFoundation $query | ||
Résultat | Symfony\Component\HttpFoundation\ParameterBag |
public ParameterBag,Symfony\Component\HttpFoundation $request | ||
Résultat | Symfony\Component\HttpFoundation\ParameterBag |
public ServerBag,Symfony\Component\HttpFoundation $server | ||
Résultat |
protected SessionInterface,Symfony\Component\HttpFoundation\Session $session | ||
Résultat | Symfony\Component\HttpFoundation\Session\SessionInterface |
protected static $trustedHeaders |
protected static string[] $trustedHostPatterns | ||
Résultat | string[] |
protected static string[] $trustedHosts | ||
Résultat | string[] |