Properties

$path

$path : string

The path

Type

string

$parameters

$parameters : array

The input parameters (inline parameters)

Type

array

$input

$input : array

The input (like stdin)

Type

array

$method

$method : string

The used method for this request

Type

string

$scheme

$scheme : string

The scheme used to access this route

Type

string

$domain

$domain : string

The request host domain name

Type

string

$headers

$headers : array

The headers sent to this route

Type

array

$cookies

$cookies : array

The cookies sent to this route

Type

array

$files

$files : array

The uploaded files sent to this route

Type

array

$inputType

$inputType : string

The input content type

Type

string

$pathValues

$pathValues : \stdClass

The values in path

Type

\stdClass

Methods

__construct()

__construct(string  $method, string  $path, array  $parameters = null, array  $input = null) 

Constructor

Parameters

string $method
string $path
array $parameters
array $input

findFirstMatchingRoute()

findFirstMatchingRoute(boolean  $alternative = false) : \Orpheus\InputController\HTTPController\Route

Find a matching route according to the request

Parameters

boolean $alternative

Is this looking for an alternative route ?

Returns

\Orpheus\InputController\HTTPController\Route

getPath()

getPath() : string

Get the path

Returns

string

getParameter()

getParameter(string  $key, mixed  $default = null) : mixed

Get the parameter by $key, assuming $default value

Parameters

string $key
mixed $default

Returns

mixed

hasParameter()

hasParameter(string  $key) : boolean

Test if parameter $key exists in this request

Parameters

string $key

Returns

boolean

getParameters()

getParameters() : array

Get all parameters

Returns

array

hasInput()

hasInput() : boolean

Test if request has any input

Returns

boolean

getInput()

getInput() : array

Get input

Returns

array

getInputValue()

getInputValue(string  $key, mixed  $default = null) : mixed

Get the input by $key, assuming $default value

Parameters

string $key
mixed $default

Returns

mixed

hasInputValue()

hasInputValue(string  $key) : boolean

Test if input $key exists in this request

Parameters

string $key

Returns

boolean

getRouteName()

getRouteName() : string

Get the route name to this request

Returns

string

__toString()

__toString() : string

Get this request as string

Returns

string

getURL()

getURL() : string

Get the URL used for this request

Returns

string

handleCurrentRequest()

handleCurrentRequest() 

Handle the current request as a HTTPRequest one This method ends the script

getRouteClass()

getRouteClass() : string

Get the name of the route class associated to a HTTPRequest

Returns

string

getMethod()

getMethod() : string

Get the method

Returns

string

isGET()

isGET() : boolean

Test if this is a GET request

Returns

boolean

isPOST()

isPOST() : boolean

Test if this is a POST request

Returns

boolean

isPUT()

isPUT() : boolean

Test if this is a PUT request

Returns

boolean

isDELETE()

isDELETE() : boolean

Test if this is a DELETE request

Returns

boolean

getScheme()

getScheme() : string

Get the scheme

Returns

string

getDomain()

getDomain() : string

Get the host domain

Returns

string

getHeaders()

getHeaders() : array

Get the headers

Returns

array

getInputType()

getInputType() : string

Get the input type

Returns

string

getCookies()

getCookies() : array

Get the cookies

Returns

array

getFiles()

getFiles() : array

Get the uploaded files

Returns

array

getAllData()

getAllData() : array

Get all input data

Returns

array

getData()

getData(string  $key, mixed  $default = null) : mixed

Get a data by $key, assuming $default

Parameters

string $key
mixed $default

Returns

mixed

getArrayData()

getArrayData(string  $key) : mixed

Get the data by key with array as default

Parameters

string $key

Returns

mixed

hasArrayData()

hasArrayData(string  $key = null) : boolean

Test if data $key is an array

Parameters

string $key

Returns

boolean

hasData()

hasData(string  $key = null) : boolean

Test if data contains the $key

Parameters

string $key

Returns

boolean

hasDataKey()

hasDataKey(string  $path = null, string  $value = null) : boolean

Test if path contains a value and return it as parameter

Parameters

string $path

The path to get the value

string $value

The value as ouput parameter

Returns

boolean

getPathValues()

getPathValues() : \Orpheus\InputController\HTTPController\stdClass

Get path values

Returns

\Orpheus\InputController\HTTPController\stdClass

getPathValue()

getPathValue(string  $key, mixed  $default = null) : string

Get path value by $key, assuming $default

Parameters

string $key
mixed $default

Returns

string —

The path value for $key

hasPathValue()

hasPathValue(string  $key) : boolean

Check request has path value $key

Parameters

string $key

Returns

boolean —

True if it has the $key value in path

setContent()

setContent(string  $content, string  $contentType) : \Orpheus\InputController\HTTPController\HTTPRequest

Set the content (input & input type)

Parameters

string $content
string $contentType

Returns

\Orpheus\InputController\HTTPController\HTTPRequest