HttpRequest extends Request
Class HttpRequest extends Request. Contains http specific request data.
Table of Contents
Methods
- __construct() : mixed
- Creates new HttpRequest object
- __unserialize() : void
- addFilter() : mixed
- Applies filter to the http request data. Preserve original values.
- clear() : mixed
- decodeJson() : void
- Decodes JSON from application/json requests.
- decodeJsonStrict() : void
- get() : string|array<string|int, mixed>|null
- Returns any variable by its name. Null if variable is not set.
- getAcceptedLanguages() : mixed
- getCookie() : null|string
- Returns the COOKIES parameter of the current request.
- getCookieList() : ParameterDictionary
- Returns the list of COOKIES parameters of the current request.
- getCookieRaw() : mixed
- getCookieRawList() : mixed
- getCookiesMode() : null|string
- Returns Y if persistant cookies are enabled, N if disabled, or empty if unknown.
- getDecodedUri() : string
- Returns url-decoded and converted to the current encoding URI of the request (except the query string).
- getFile() : string|array<string|int, mixed>|null
- Returns the FILES parameter of the current request.
- getFileList() : ParameterDictionary
- Returns the list of FILES parameters of the current request.
- getHeader() : null|string
- Returns the header of the current request.
- getHeaders() : HttpHeaders
- Returns the list of headers of the current request.
- getHttpHost() : string
- Returns the host from the server variable without a port number.
- getInput() : bool|string
- Returns raw request data from php://input.
- getJsonList() : mixed
- getPhpSelf() : mixed
- getPost() : string|array<string|int, mixed>|null
- Returns the POST parameter of the current request.
- getPostList() : ParameterDictionary
- Returns the list of POST parameters of the current request.
- getQuery() : null|string|array<string|int, mixed>
- Returns the GET parameter of the current request.
- getQueryList() : ParameterDictionary
- Returns the list of GET parameters of the current request.
- getRaw() : string|null
- Returns original value of any variable by its name. Null if variable is not set.
- getRemoteAddress() : mixed
- getRequestedPage() : string
- Returns the current page calculated from the request URI.
- getRequestedPageDirectory() : string
- Retuns the current directory with a trailing slash (/).
- getRequestMethod() : mixed
- getRequestUri() : mixed
- getScriptFile() : string
- Returns script file possibly corrected by urlrewrite.php.
- getScriptName() : mixed
- getServer() : Server
- getServerPort() : string|null
- Returns server port.
- getSystemParameters() : array<string|int, mixed>
- Returns the array with predefined query parameters.
- getUserAgent() : null|string
- Returns the User-Agent HTTP request header.
- getValues() : array<string|int, mixed>
- isAdminSection() : mixed
- isAjaxRequest() : bool
- Returns true if current request is AJAX
- isEmpty() : bool
- Returns true if the dictionary is empty.
- isHttps() : mixed
- isJson() : bool
- isPost() : mixed
- jsonSerialize() : array<string|int, mixed>
- JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
- modifyByQueryString() : mixed
- offsetSet() : mixed
- Offset to set
- offsetUnset() : void
- Offset to unset
- set() : mixed
- setValues() : mixed
- toArray() : array<string|int, mixed>
- Returns the values as an array.
- toArrayRaw() : mixed
Methods
__construct()
Creates new HttpRequest object
public
__construct(Server $server, array<string|int, mixed> $queryString, array<string|int, mixed> $postData, array<string|int, mixed> $files, array<string|int, mixed> $cookies[, array<string|int, mixed> $jsonData = [] ]) : mixed
Parameters
- $server : Server
- $queryString : array<string|int, mixed>
-
_GET
- $postData : array<string|int, mixed>
-
_POST
- $files : array<string|int, mixed>
-
_FILES
- $cookies : array<string|int, mixed>
-
_COOKIE
- $jsonData : array<string|int, mixed> = []
__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
addFilter()
Applies filter to the http request data. Preserve original values.
public
addFilter(IRequestFilter $filter) : mixed
Parameters
- $filter : IRequestFilter
-
Filter object
clear()
public
clear() : mixed
decodeJson()
Decodes JSON from application/json requests.
public
decodeJson() : void
decodeJsonStrict()
public
decodeJsonStrict() : void
get()
Returns any variable by its name. Null if variable is not set.
public
get(string $name) : string|array<string|int, mixed>|null
Parameters
- $name : string
Return values
string|array<string|int, mixed>|nullgetAcceptedLanguages()
public
getAcceptedLanguages() : mixed
getCookie()
Returns the COOKIES parameter of the current request.
public
getCookie(mixed $name) : null|string
Parameters
- $name : mixed
Return values
null|stringgetCookieList()
Returns the list of COOKIES parameters of the current request.
public
getCookieList() : ParameterDictionary
Return values
ParameterDictionarygetCookieRaw()
public
getCookieRaw(mixed $name) : mixed
Parameters
- $name : mixed
getCookieRawList()
public
getCookieRawList() : mixed
getCookiesMode()
Returns Y if persistant cookies are enabled, N if disabled, or empty if unknown.
public
getCookiesMode() : null|string
Return values
null|stringgetDecodedUri()
Returns url-decoded and converted to the current encoding URI of the request (except the query string).
public
getDecodedUri() : string
Return values
stringgetFile()
Returns the FILES parameter of the current request.
public
getFile(mixed $name) : string|array<string|int, mixed>|null
Parameters
- $name : mixed
Return values
string|array<string|int, mixed>|nullgetFileList()
Returns the list of FILES parameters of the current request.
public
getFileList() : ParameterDictionary
Return values
ParameterDictionarygetHeader()
Returns the header of the current request.
public
getHeader(string $name) : null|string
Parameters
- $name : string
-
Name of header.
Return values
null|stringgetHeaders()
Returns the list of headers of the current request.
public
getHeaders() : HttpHeaders
Return values
HttpHeadersgetHttpHost()
Returns the host from the server variable without a port number.
public
getHttpHost() : string
Return values
stringgetInput()
Returns raw request data from php://input.
public
static getInput() : bool|string
Return values
bool|stringgetJsonList()
public
getJsonList() : mixed
getPhpSelf()
public
getPhpSelf() : mixed
getPost()
Returns the POST parameter of the current request.
public
getPost(mixed $name) : string|array<string|int, mixed>|null
Parameters
- $name : mixed
Return values
string|array<string|int, mixed>|nullgetPostList()
Returns the list of POST parameters of the current request.
public
getPostList() : ParameterDictionary
Return values
ParameterDictionarygetQuery()
Returns the GET parameter of the current request.
public
getQuery(string $name) : null|string|array<string|int, mixed>
Parameters
- $name : string
-
Parameter name
Return values
null|string|array<string|int, mixed>getQueryList()
Returns the list of GET parameters of the current request.
public
getQueryList() : ParameterDictionary
Return values
ParameterDictionarygetRaw()
Returns original value of any variable by its name. Null if variable is not set.
public
getRaw(string $name) : string|null
Parameters
- $name : string
Return values
string|nullgetRemoteAddress()
public
getRemoteAddress() : mixed
getRequestedPage()
Returns the current page calculated from the request URI.
public
getRequestedPage() : string
Return values
stringgetRequestedPageDirectory()
Retuns the current directory with a trailing slash (/).
public
getRequestedPageDirectory() : string
Return values
stringgetRequestMethod()
public
getRequestMethod() : mixed
getRequestUri()
public
getRequestUri() : mixed
getScriptFile()
Returns script file possibly corrected by urlrewrite.php.
public
getScriptFile() : string
Return values
stringgetScriptName()
public
getScriptName() : mixed
getServer()
public
getServer() : Server
Return values
ServergetServerPort()
Returns server port.
public
getServerPort() : string|null
Return values
string|nullgetSystemParameters()
Returns the array with predefined query parameters.
public
static getSystemParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserAgent()
Returns the User-Agent HTTP request header.
public
getUserAgent() : null|string
Return values
null|stringgetValues()
public
getValues() : array<string|int, mixed>
Return values
array<string|int, mixed>isAdminSection()
public
isAdminSection() : mixed
isAjaxRequest()
Returns true if current request is AJAX
public
isAjaxRequest() : bool
Return values
boolisEmpty()
Returns true if the dictionary is empty.
public
isEmpty() : bool
Return values
boolisHttps()
public
isHttps() : mixed
isJson()
public
isJson() : bool
Return values
boolisPost()
public
isPost() : mixed
jsonSerialize()
JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
public
jsonSerialize() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>modifyByQueryString()
public
modifyByQueryString(mixed $queryString) : mixed
Parameters
- $queryString : mixed
offsetSet()
Offset to set
public
offsetSet(mixed $offset, mixed $value) : mixed
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
Offset to unset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
set()
public
set(mixed $name[, mixed $value = null ]) : mixed
Parameters
- $name : mixed
- $value : mixed = null
setValues()
public
setValues(mixed $values) : mixed
Parameters
- $values : mixed
toArray()
Returns the values as an array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toArrayRaw()
public
toArrayRaw() : mixed