Orpheus

HttpRequest extends InputRequest
in package

Table of Contents

Properties

$cookies  : array<string|int, mixed>
The cookies sent to this route
$defaultController  : HttpController|null
$domain  : string
The request host domain name
$files  : array<string|int, mixed>
The uploaded files sent to this route
$headers  : array<string|int, mixed>
The headers sent to this route
$input  : array<string|int, mixed>|string|null
The input (like stdin)
$inputType  : string
The input content type
$mainRequest  : static|null
The current main request
$method  : string
The used method for this request
$parameters  : array<string|int, mixed>
The input parameters (inline parameters)
$path  : string
The path
$pathValues  : array<string|int, mixed>
The values in path
$route  : ControllerRoute|null
The found route for this request A request could exist without any route (e.g. Route initialization failed)
$scheme  : string
The scheme used to access this route

Methods

__construct()  : mixed
Constructor
__toString()  : string
Get this request as string
cloneWithPath()  : InputRequest
Clone this request using another path (expecting a sub path)
findFirstMatchingRoute()  : array<string|int, mixed>
Find a matching route according to the request
formatUrl()  : string
Generate new URL for this request
generateFromEnvironment()  : HttpRequest
Generate HttpRequest from environment
getAllData()  : array<string|int, mixed>
Get all input data
getArrayData()  : mixed
Get the data by key with array as default
getConfigPostMaxSize()  : int
Get php config for max post size
getController()  : AbstractController
Get running controller
getCookies()  : array<string|int, mixed>
Get the cookies
getData()  : mixed
Get a data by $key, assuming $default
getDefaultController()  : HttpController
getDomain()  : string
Get the host domain
getFiles()  : array<string|int, mixed>
Get the uploaded files
getHeaderContentLength()  : int|null
Get the header Content-Length
getHeaders()  : array<string|int, mixed>
Get the headers
getInput()  : array<string|int, mixed>
Get input
getInputType()  : string
Get the input type
getInputValue()  : mixed
Get the input by $key, assuming $default value
getMainHttpRequest()  : HttpRequest|null
Get the main http request or null if not an HTTP request
getMainRequest()  : InputRequest|null
Get the main input request
getMainRequest()  : HttpRequest
Get the main input request
getMethod()  : string
Get the method
getOption()  : mixed
Get the option by $key, assuming $default value
getParameter()  : mixed
Get the parameter by $key, assuming $default value
getParameters()  : array<string|int, mixed>
Get all parameters
getPath()  : string
Get the path
getPathValue()  : string|null
Get path value by $key, assuming $default
getPathValues()  : array<string|int, mixed>
Get path values
getRoute()  : ControllerRoute|null
Get the route to this request
getRouteClass()  : string
Get the name of the route class associated to a HttpRequest
getRouteName()  : string
Get the route name to this request
getRoutes()  : array<string|int, HttpRoute>
Get all available routes
getScheme()  : string
Get the scheme
getUrl()  : string
Get the URL used for this request
handleCurrentRequest()  : void
Handle the current request as a HttpRequest one This method ends the script
hasArrayData()  : bool
Test if data $key is an array
hasData()  : bool
Test if data contains the $key
hasDataKey()  : bool
Test if path contains a value and return it as parameter
hasInput()  : bool
Test if request has any input
hasInputValue()  : bool
Test if input $key exists in this request
hasParameter()  : bool
Test if parameter $key exists in this request
hasPathValue()  : bool
Check request has path value $key
isDelete()  : bool
Test if this is a DELETE request
isGet()  : bool
Test if this is a GET request
isPost()  : bool
Test if this is a POST request
isPostSiteOverLimit()  : bool
Test incoming request is over php max post size
isPut()  : bool
Test if this is a PUT request
matchPath()  : string
Test path is matching regex
process()  : OutputResponse
Process the request by finding a route and processing it
processRoute()  : OutputResponse
Process the given route
redirect()  : RedirectHttpResponse|null
Redirect response to $route
setRoute()  : InputRequest
Set the route to this request
showFallbackError()  : void
setContent()  : HttpRequest
Set the content (input & input type)
setCookies()  : HttpRequest
Set the cookies
setDomain()  : $this
Set the host domain
setFiles()  : HttpRequest
Set the uploaded files
setHeaders()  : HttpRequest
Set the headers
setInput()  : InputRequest
Set the input
setInputType()  : HttpRequest
Set the input type
setMethod()  : HttpRequest
Set the method
setParameters()  : InputRequest
Set the parameters
setPath()  : InputRequest
Set the path
setScheme()  : HttpRequest
Set the scheme

Properties

$cookies

The cookies sent to this route

protected array<string|int, mixed> $cookies = []

$domain

The request host domain name

protected string $domain

$files

The uploaded files sent to this route

protected array<string|int, mixed> $files = []

$headers

The headers sent to this route

protected array<string|int, mixed> $headers = []

$input

The input (like stdin)

protected array<string|int, mixed>|string|null $input

$mainRequest

The current main request

protected static static|null $mainRequest = null

$method

The used method for this request

protected string $method

$parameters

The input parameters (inline parameters)

protected array<string|int, mixed> $parameters

$pathValues

The values in path

protected array<string|int, mixed> $pathValues

$route

The found route for this request A request could exist without any route (e.g. Route initialization failed)

protected ControllerRoute|null $route = null

$scheme

The scheme used to access this route

protected string $scheme

Methods

__construct()

Constructor

public __construct(string $method, string $path, array<string|int, mixed> $parameters[, array<string|int, mixed>|null $input = null ]) : mixed
Parameters
$method : string
$path : string
$parameters : array<string|int, mixed>
$input : array<string|int, mixed>|null = null

__toString()

Get this request as string

public __toString() : string
Return values
string

cloneWithPath()

Clone this request using another path (expecting a sub path)

public cloneWithPath(string $path) : InputRequest
Parameters
$path : string
Return values
InputRequest

findFirstMatchingRoute()

Find a matching route according to the request

public findFirstMatchingRoute() : array<string|int, mixed>
Return values
array<string|int, mixed>

formatUrl()

Generate new URL for this request

public formatUrl([array<string|int, mixed> $values = [] ]) : string
Parameters
$values : array<string|int, mixed> = []

Force parameters

Return values
string

getAllData()

Get all input data

public getAllData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getArrayData()

Get the data by key with array as default

public getArrayData(string $key) : mixed
Parameters
$key : string

getConfigPostMaxSize()

Get php config for max post size

public getConfigPostMaxSize() : int
Tags
throws
Exception
Return values
int

getCookies()

Get the cookies

public getCookies() : array<string|int, mixed>
Return values
array<string|int, mixed>

getData()

Get a data by $key, assuming $default

public getData(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

getDomain()

Get the host domain

public getDomain() : string
Return values
string

getFiles()

Get the uploaded files

public getFiles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHeaderContentLength()

Get the header Content-Length

public getHeaderContentLength() : int|null
Return values
int|null

getHeaders()

Get the headers

public getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInput()

Get input

public getInput() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInputType()

Get the input type

public getInputType() : string
Return values
string

getInputValue()

Get the input by $key, assuming $default value

public getInputValue(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null

getMainHttpRequest()

Get the main http request or null if not an HTTP request

public static getMainHttpRequest() : HttpRequest|null
Return values
HttpRequest|null

getMethod()

Get the method

public getMethod() : string
Return values
string

getOption()

Get the option by $key, assuming $default value

public getOption(string $key[, string|null $short = null ][, mixed|null $default = null ]) : mixed
Parameters
$key : string
$short : string|null = null
$default : mixed|null = null

getParameter()

Get the parameter by $key, assuming $default value

public getParameter(string $key[, mixed|null $default = null ]) : mixed
Parameters
$key : string
$default : mixed|null = null

getParameters()

Get all parameters

public getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPath()

Get the path

public getPath() : string
Return values
string

getPathValue()

Get path value by $key, assuming $default

public getPathValue(string $key[, mixed $default = null ]) : string|null
Parameters
$key : string
$default : mixed = null
Return values
string|null

The path value for $key

getPathValues()

Get path values

public getPathValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRouteClass()

Get the name of the route class associated to a HttpRequest

public static getRouteClass() : string
Return values
string

getRouteName()

Get the route name to this request

public getRouteName() : string
Return values
string

getScheme()

Get the scheme

public getScheme() : string
Return values
string

getUrl()

Get the URL used for this request

public getUrl() : string
Return values
string

handleCurrentRequest()

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

public static handleCurrentRequest() : void

hasArrayData()

Test if data $key is an array

public hasArrayData(string $key) : bool
Parameters
$key : string
Return values
bool

hasData()

Test if data contains the $key

public hasData([string|null $key = null ]) : bool
Parameters
$key : string|null = null
Return values
bool

hasDataKey()

Test if path contains a value and return it as parameter

public hasDataKey([string|null $path = null ][, string|null &$key = null ]) : bool
Parameters
$path : string|null = null

The path to get the value

$key : string|null = null

The value as output parameter

Return values
bool

hasInput()

Test if request has any input

public hasInput() : bool
Return values
bool

hasInputValue()

Test if input $key exists in this request

public hasInputValue(string $key) : bool
Parameters
$key : string
Return values
bool

hasParameter()

Test if parameter $key exists in this request

public hasParameter(string $key) : bool
Parameters
$key : string
Return values
bool

hasPathValue()

Check request has path value $key

public hasPathValue(string $key) : bool
Parameters
$key : string
Return values
bool

True if it has the $key value in path

isDelete()

Test if this is a DELETE request

public isDelete() : bool
Return values
bool

isGet()

Test if this is a GET request

public isGet() : bool
Return values
bool

isPost()

Test if this is a POST request

public isPost() : bool
Return values
bool

isPostSiteOverLimit()

Test incoming request is over php max post size

public isPostSiteOverLimit() : bool
Tags
throws
Exception
Return values
bool

isPut()

Test if this is a PUT request

public isPut() : bool
Return values
bool

matchPath()

Test path is matching regex

public matchPath(string $regex, array<string|int, mixed>|null &$matches) : string
Parameters
$regex : string
$matches : array<string|int, mixed>|null
Return values
string

showFallbackError()

public static showFallbackError(Throwable $exception, Throwable|null $responseException) : void
Parameters
$exception : Throwable
$responseException : Throwable|null

setContent()

Set the content (input & input type)

protected setContent(array<string|int, mixed>|string|null $content, string $contentType) : HttpRequest
Parameters
$content : array<string|int, mixed>|string|null
$contentType : string
Return values
HttpRequest

setCookies()

Set the cookies

protected setCookies(array<string|int, mixed> $cookies) : HttpRequest
Parameters
$cookies : array<string|int, mixed>
Return values
HttpRequest

setDomain()

Set the host domain

protected setDomain(string $domain) : $this
Parameters
$domain : string
Return values
$this

setFiles()

Set the uploaded files

protected setFiles(array<string|int, mixed> $files) : HttpRequest
Parameters
$files : array<string|int, mixed>
Return values
HttpRequest

setHeaders()

Set the headers

protected setHeaders(array<string|int, mixed> $headers) : HttpRequest
Parameters
$headers : array<string|int, mixed>
Return values
HttpRequest

setInput()

Set the input

protected setInput(array<string|int, mixed>|string|null $input) : InputRequest
Parameters
$input : array<string|int, mixed>|string|null
Return values
InputRequest

setParameters()

Set the parameters

protected setParameters(array<string|int, mixed> $parameters) : InputRequest
Parameters
$parameters : array<string|int, mixed>
Return values
InputRequest

							
On this page

Search results