HttpContext
in package
implements
HttpContextInterface
Class HttpContext
Tags
Interfaces, Classes and Traits
- HttpContextInterface
- Interface HttpContextInterface
Table of Contents
- $cookieArray : array<string|int, mixed>
- $getArray : array<string|int, mixed>
- $postArray : array<string|int, mixed>
- $serverArray : array<string|int, mixed>
- $sessionArray : array<string|int, mixed>
- __construct() : mixed
- Initializes the http context.
- getCookieItem() : array<string|int, mixed>|string|int|float
- Returns an item of the $_COOKIE array by the given key name.
- getGetArray() : array<string|int, mixed>
- Returns an array which is equal to the global $_GET variable in an object oriented layer.
- getGetItem() : array<string|int, mixed>|string|int|float
- Returns an item of the $_GET array by the given key name.
- getPostArray() : array<string|int, mixed>
- Returns an array which is equal to the global $_POST variable in an object oriented layer.
- getPostItem() : array<string|int, mixed>|string|int|float
- Returns an item of the $_POST array by the given key name.
- getServerArray() : array<string|int, mixed>
- Returns an array which is equal to the global $_SERVER variable in an object oriented layer.
- getServerItem() : array<string|int, mixed>|string|int|float
- Returns an item of the $_SERVER array by the given key name.
- getSessionItem() : array<string|int, mixed>|string|int|float
- Returns an item of the $_SESSION array by the given key name.
Properties
$cookieArray
protected
array<string|int, mixed>
$cookieArray
$getArray
protected
array<string|int, mixed>
$getArray
$postArray
protected
array<string|int, mixed>
$postArray
$serverArray
protected
array<string|int, mixed>
$serverArray
$sessionArray
protected
array<string|int, mixed>
$sessionArray
Methods
__construct()
Initializes the http context.
public
__construct(array<string|int, mixed> $serverArray, array<string|int, mixed> $getArray, array<string|int, mixed> $postArray, array<string|int, mixed> $cookieArray, array<string|int, mixed> $sessionArray) : mixed
Parameters
- $serverArray : array<string|int, mixed>
-
Usually, the $_SERVER array is passed here.
- $getArray : array<string|int, mixed>
-
Usually, the $_GET array is passed here.
- $postArray : array<string|int, mixed>
-
Usually, the $_POST array is passed here.
- $cookieArray : array<string|int, mixed>
-
Usually, the $_COOKIE array is passed here.
- $sessionArray : array<string|int, mixed>
-
Usually, the $_SESSION array is passed here.
Return values
mixed —getCookieItem()
Returns an item of the $_COOKIE array by the given key name.
public
getCookieItem(string $keyName) : array<string|int, mixed>|string|int|float
Parameters
- $keyName : string
-
Key to determine which value of the $_COOKIE array should be returned.
Return values
array<string|int, mixed>|string|int|float —Expected item of $_COOKIE array.
getGetArray()
Returns an array which is equal to the global $_GET variable in an object oriented layer.
public
getGetArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array which is equal to $_GET.
getGetItem()
Returns an item of the $_GET array by the given key name.
public
getGetItem(string $keyName) : array<string|int, mixed>|string|int|float
Parameters
- $keyName : string
-
Key to determine which value of the $_GET array should be returned.
Return values
array<string|int, mixed>|string|int|float —Expected item of $_GET array.
getPostArray()
Returns an array which is equal to the global $_POST variable in an object oriented layer.
public
getPostArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array which is equal to $_POST.
getPostItem()
Returns an item of the $_POST array by the given key name.
public
getPostItem(string $keyName) : array<string|int, mixed>|string|int|float
Parameters
- $keyName : string
-
Key to determine which value of the $_POST array should be returned.
Return values
array<string|int, mixed>|string|int|float —Expected item of $_POST array.
getServerArray()
Returns an array which is equal to the global $_SERVER variable in an object oriented layer.
public
getServerArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array which is equal to $_SERVER.
getServerItem()
Returns an item of the $_SERVER array by the given key name.
public
getServerItem(string $keyName) : array<string|int, mixed>|string|int|float
Parameters
- $keyName : string
-
Key to determine which value of the $_SERVER array should be returned.
Return values
array<string|int, mixed>|string|int|float —Expected item of $_SERVER array.
getSessionItem()
Returns an item of the $_SESSION array by the given key name.
public
getSessionItem(string $keyName) : array<string|int, mixed>|string|int|float
Parameters
- $keyName : string
-
Key to determine which value of the $_SESSION array should be returned.
Return values
array<string|int, mixed>|string|int|float —Expected item of $_SESSION array.