HttpContext

Implements \HttpContextInterface

Class HttpContext

category

System

package

Http

subpackage

ValueObjects

extends

HttpContextInterface

Methods

Initializes the http context.

__construct(array $serverArray, array $getArray, array $postArray, array $cookieArray, array $sessionArray) 

Arguments

$serverArray

array

Usually, the $_SERVER array is passed here.

$getArray

array

Usually, the $_GET array is passed here.

$postArray

array

Usually, the $_POST array is passed here.

$cookieArray

array

Usually, the $_COOKIE array is passed here.

$sessionArray

array

Usually, the $_SESSION array is passed here.

Returns an item of the $_COOKIE array by the given key name.

getCookieItem(string $keyName) : array|string|integer|double

Arguments

$keyName

string

Key to determine which value of the $_COOKIE array should be returned.

Response

array|string|integer|double

Expected item of $_COOKIE array.

Returns an array which is equal to the global $_GET variable in an object oriented layer.

getGetArray() : array

Response

array

Array which is equal to $_GET.

Returns an item of the $_GET array by the given key name.

getGetItem(string $keyName) : array|string|integer|double

Arguments

$keyName

string

Key to determine which value of the $_GET array should be returned.

Response

array|string|integer|double

Expected item of $_GET array.

Returns an array which is equal to the global $_POST variable in an object oriented layer.

getPostArray() : array

Response

array

Array which is equal to $_POST.

Returns an item of the $_POST array by the given key name.

getPostItem(string $keyName) : array|string|integer|double

Arguments

$keyName

string

Key to determine which value of the $_POST array should be returned.

Response

array|string|integer|double

Expected item of $_POST array.

Returns an array which is equal to the global $_SERVER variable in an object oriented layer.

getServerArray() : array

Response

array

Array which is equal to $_SERVER.

Returns an item of the $_SERVER array by the given key name.

getServerItem(string $keyName) : array|string|integer|double

Arguments

$keyName

string

Key to determine which value of the $_SERVER array should be returned.

Response

array|string|integer|double

Expected item of $_SERVER array.

Returns an item of the $_SESSION array by the given key name.

getSessionItem(string $keyName) : array|string|integer|double

Arguments

$keyName

string

Key to determine which value of the $_SESSION array should be returned.

Response

array|string|integer|double

Expected item of $_SESSION array.

Properties

serverArray

serverArray : array
var

Type(s)

array

getArray

getArray : array
var

Type(s)

array

postArray

postArray : array
var

Type(s)

array

cookieArray

cookieArray : array
var

Type(s)

array

sessionArray

sessionArray : array
var

Type(s)

array