Properties

$requestUri

$requestUri : string

Request URI

Type

string

$segments

$segments : array

Path segments

Type

array

$basePath

$basePath : string

Base path

Type

string

$headers

$headers : array

Headers

Type

array

$rawData

$rawData : string

Raw data

Type

string

$parsedData

$parsedData : mixed

Parsed data

Type

mixed

$get

$get : 

GET array

Type

$post

$post : 

POST array

Type

$files

$files : 

FILES array

Type

$put

$put : 

PUT array

Type

$patch

$patch : 

PATCH array

Type

$delete

$delete : 

DELETE array

Type

$cookie

$cookie : 

COOKIE array

Type

$server

$server : 

SERVER array

Type

$env

$env : 

ENV array

Type

Methods

__construct()

__construct(string  $uri = null, string  $basePath = null) 

Constructor

Instantiate the request object

Parameters

string $uri
string $basePath

hasFiles()

hasFiles() : boolean

Return whether or not the request has FILES

Returns

boolean

isGet()

isGet() : boolean

Return whether or not the method is GET

Returns

boolean

isHead()

isHead() : boolean

Return whether or not the method is HEAD

Returns

boolean

isPost()

isPost() : boolean

Return whether or not the method is POST

Returns

boolean

isPut()

isPut() : boolean

Return whether or not the method is PUT

Returns

boolean

isDelete()

isDelete() : boolean

Return whether or not the method is DELETE

Returns

boolean

isTrace()

isTrace() : boolean

Return whether or not the method is TRACE

Returns

boolean

isOptions()

isOptions() : boolean

Return whether or not the method is OPTIONS

Returns

boolean

isConnect()

isConnect() : boolean

Return whether or not the method is CONNECT

Returns

boolean

isPatch()

isPatch() : boolean

Return whether or not the method is PATCH

Returns

boolean

isSecure()

isSecure() : boolean

Return whether or not the request is secure

Returns

boolean

getBasePath()

getBasePath() : string

Get the base path

Returns

string

getRequestUri()

getRequestUri() : string

Get the request URI

Returns

string

getFullRequestUri()

getFullRequestUri() : string

Get the full request URI, including base path

Returns

string

getSegment()

getSegment(integer  $i) : string

Get a path segment, divided by the forward slash, where $i refers to the array key index, i.e., 0 1 2 /hello/world/page

Parameters

integer $i

Returns

string

getSegments()

getSegments() : array

Get all path segments

Returns

array

getDocumentRoot()

getDocumentRoot() : string

Get the document root

Returns

string

getMethod()

getMethod() : string

Get the method

Returns

string

getPort()

getPort() : string

Get the server port

Returns

string

getScheme()

getScheme() : string

Get scheme

Returns

string

getHost()

getHost() : string

Get host without port)

Returns

string

getFullHost()

getFullHost() : string

Get host with port

Returns

string

getIp()

getIp(boolean  $proxy = true) : string

Get client's IP

Parameters

boolean $proxy

Returns

string

getQuery()

getQuery(string  $key = null) : string|array

Get a value from $_GET, or the whole array

Parameters

string $key

Returns

string|array

getPost()

getPost(string  $key = null) : string|array

Get a value from $_POST, or the whole array

Parameters

string $key

Returns

string|array

getFiles()

getFiles(string  $key = null) : string|array

Get a value from $_FILES, or the whole array

Parameters

string $key

Returns

string|array

getPut()

getPut(string  $key = null) : string|array

Get a value from PUT query data, or the whole array

Parameters

string $key

Returns

string|array

getPatch()

getPatch(string  $key = null) : string|array

Get a value from PATCH query data, or the whole array

Parameters

string $key

Returns

string|array

getDelete()

getDelete(string  $key = null) : string|array

Get a value from DELETE query data, or the whole array

Parameters

string $key

Returns

string|array

getCookie()

getCookie(string  $key = null) : string|array

Get a value from $_COOKIE, or the whole array

Parameters

string $key

Returns

string|array

getServer()

getServer(string  $key = null) : string|array

Get a value from $_SERVER, or the whole array

Parameters

string $key

Returns

string|array

getEnv()

getEnv(string  $key = null) : string|array

Get a value from $_ENV, or the whole array

Parameters

string $key

Returns

string|array

getParsedData()

getParsedData(string  $key = null) : string|array

Get a value from parsed data, or the whole array

Parameters

string $key

Returns

string|array

getHeader()

getHeader(string  $key) : string

Get a value from the request headers

Parameters

string $key

Returns

string

getHeaders()

getHeaders() : array

Get the request headers

Returns

array

getRawData()

getRawData() : string

Get the raw data

Returns

string

setBasePath()

setBasePath(string  $path = null) : \Pop\Http\Request

Set the base path

Parameters

string $path

Returns

\Pop\Http\Request

setRequestUri()

setRequestUri(string  $uri = null, string  $basePath = null) : \Pop\Http\Request

Set the request URI

Parameters

string $uri
string $basePath

Returns

\Pop\Http\Request

__get()

__get(string  $name) : mixed

Magic method to get a value from one of the server/environment variables

Parameters

string $name

Returns

mixed

parseData()

parseData() : void

Parse any data that came with the request