Properties

$requestUri

$requestUri : string

Request URI

Type

string

$path

$path : array

Path segments

Type

array

$basePath

$basePath : string

Base path

Type

string

$docRoot

$docRoot : string

Document root

Type

string

$fullPath

$fullPath : string

Full path

Type

string

$filename

$filename : string

Request filename

Type

string

$isFile

$isFile : boolean

Is the request a real file

Type

boolean

$isSecure

$isSecure : boolean

Is the request secure

Type

boolean

$get

$get : array

$_GET vars

Type

array

$post

$post : array

$_POST vars

Type

array

$files

$files : array

$_FILES vars

Type

array

$put

$put : array

PUT method vars

Type

array

$patch

$patch : array

PATCH method vars

Type

array

$delete

$delete : array

DELETE method vars

Type

array

$cookie

$cookie : array

$_COOKIE vars

Type

array

$server

$server : array

$_SERVER vars

Type

array

$env

$env : array

$_ENV vars

Type

array

$headers

$headers : array

Headers

Type

array

$rawData

$rawData : string

Raw data

Type

string

$parsedData

$parsedData : mixed

Parsed data

Type

mixed

Methods

__construct()

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

Constructor

Instantiate the request object

Parameters

string $uri
string $basePath

Returns

\Pop\Http\Request

isFile()

isFile() : boolean

Return if the file is an actual file

Returns

boolean

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

Returns

string

getPath()

getPath(integer  $num = null) : string|array

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

No $num returns the whole path segment as an array, and if the $num is not set, then it returns null.

Parameters

integer $num

Returns

string|array

getDocRoot()

getDocRoot() : string

Get the doc root

Returns

string

getFullPath()

getFullPath() : string

Get the full path

Returns

string

getMethod()

getMethod() : string

Get the method

Returns

string

getFilename()

getFilename() : string

Get the filename

Returns

string

getScheme()

getScheme() : string

Get secheme

Returns

string

getHost()

getHost() : string

Get host

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

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

getParsedData()

getParsedData() : mixed

Get the parsed data

Returns

mixed

setRequestUri()

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

Set the request URI

Parameters

string $uri
string $basePath

Returns

\Pop\Http\Request

setBasePath()

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

Set the base path

Parameters

string $path

Returns

\Pop\Http\Request

setQuery()

setQuery(string  $key, string  $value) : \Pop\Http\Request

Set a value for $_GET

Parameters

string $key
string $value

Returns

\Pop\Http\Request

setPost()

setPost(string  $key, string  $value) : \Pop\Http\Request

Set a value for $_POST

Parameters

string $key
string $value

Returns

\Pop\Http\Request

setFile()

setFile(string  $key, string  $value) : \Pop\Http\Request

Set a value for $_FILES

Parameters

string $key
string $value

Returns

\Pop\Http\Request

parseData()

parseData() : void

Parse query data