PHP Интерфейс ManaPHP\Http\RequestInterface

Показать файл Открыть проект

Открытые методы

Метод Описание
get ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed Gets a variable from the $_REQUEST applying filters if needed
getAccessToken ( ) : string | null
getClientAddress ( ) : string Gets most possibly client IPv4 Address. This methods search in $_SERVER['REMOTE_ADDR'] and optionally in $_SERVER['HTTP_X_FORWARDED_FOR']
getFiles ( boolean $onlySuccessful = false ) : ManaPHP\Http\Request\FileInterface[] Gets attached files as \ManaPHP\Http\Request\FileInterface compatible instances
getGet ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed Gets variable from $_GET applying filters if needed
getHeader ( string $name ) : string | null
getJsonBody ( boolean $assoc = true ) : array | stdClass
getMethod ( ) : string
getPost ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed Gets a variable from the $_POST applying filters if needed
getPut ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed Gets a variable from put request
getQuery ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed Gets variable from $_GET applying filters if needed
getRawBody ( ) : string Gets HTTP raw request body
getReferer ( ) : string Gets web page that refers active request. ie: http://www.google.com
getScheme ( ) : string Gets HTTP schema (http/https)
getServer ( string $name = null, mixed $defaultValue = null ) : mixed Gets variable from $_SERVER
getUri ( ) : string test/test.jsp
getUrl ( boolean $withQuery = false ) : string http://localhost:8080/test/test.jsp
getUserAgent ( ) : string Gets HTTP user agent used to made the request
has ( string $name ) : boolean Checks whether $_SERVER has certain index
hasFiles ( boolean $onlySuccessful = false ) : boolean Checks whether request include attached files
hasGet ( string $name ) : boolean Checks whether $_GET has certain index
hasPost ( string $name ) : boolean Checks whether $_POST has certain index
hasPut ( string $name ) : boolean Checks whether has certain index
hasQuery ( string $name ) : boolean Checks whether $_GET has certain index
hasServer ( string $name ) : boolean Checks whether $_GET has certain index
isAjax ( ) : boolean Checks whether request has been made using ajax. Checks if $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest'
isDelete ( ) : boolean Checks whether HTTP method is DELETE. if $_SERVER['REQUEST_METHOD']=='DELETE'
isGet ( ) : boolean Checks whether HTTP method is GET. if $_SERVER['REQUEST_METHOD']=='GET'
isHead ( ) : boolean Checks whether HTTP method is HEAD. if $_SERVER['REQUEST_METHOD']=='HEAD'
isOptions ( ) : boolean Checks whether HTTP method is OPTIONS. if $_SERVER['REQUEST_METHOD']=='OPTIONS'
isPatch ( ) : boolean Checks whether HTTP method is PATCH. if $_SERVER['REQUEST_METHOD']=='PATCH'
isPost ( ) : boolean Checks whether HTTP method is POST. if $_SERVER['REQUEST_METHOD']=='POST'
isPut ( ) : boolean Checks whether HTTP method is PUT. if $_SERVER['REQUEST_METHOD']=='PUT'
setClientAddress ( string | callable $address ) : static set the client address for getClientAddress method

Описание методов

get() публичный Метод

Gets a variable from the $_REQUEST applying filters if needed
public get ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed
$name string
$rule string
$defaultValue mixed
Результат mixed

getAccessToken() публичный Метод

public getAccessToken ( ) : string | null
Результат string | null

getClientAddress() публичный Метод

Gets most possibly client IPv4 Address. This methods search in $_SERVER['REMOTE_ADDR'] and optionally in $_SERVER['HTTP_X_FORWARDED_FOR']
public getClientAddress ( ) : string
Результат string

getFiles() публичный Метод

Gets attached files as \ManaPHP\Http\Request\FileInterface compatible instances
public getFiles ( boolean $onlySuccessful = false ) : ManaPHP\Http\Request\FileInterface[]
$onlySuccessful boolean
Результат ManaPHP\Http\Request\FileInterface[]

getGet() публичный Метод

Gets variable from $_GET applying filters if needed
public getGet ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed
$name string
$rule string
$defaultValue mixed
Результат mixed

getHeader() публичный Метод

public getHeader ( string $name ) : string | null
$name string
Результат string | null

getJsonBody() публичный Метод

public getJsonBody ( boolean $assoc = true ) : array | stdClass
$assoc boolean
Результат array | stdClass

getMethod() публичный Метод

public getMethod ( ) : string
Результат string

getPost() публичный Метод

Gets a variable from the $_POST applying filters if needed
public getPost ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed
$name string
$rule string
$defaultValue mixed
Результат mixed

getPut() публичный Метод

$userEmail = $request->getPut("user_email"); $userEmail = $request->getPut("user_email", "email");
public getPut ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed
$name string
$rule string
$defaultValue mixed
Результат mixed

getQuery() публичный Метод

Gets variable from $_GET applying filters if needed
public getQuery ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed
$name string
$rule string
$defaultValue mixed
Результат mixed

getRawBody() публичный Метод

Gets HTTP raw request body
public getRawBody ( ) : string
Результат string

getReferer() публичный Метод

Gets web page that refers active request. ie: http://www.google.com
public getReferer ( ) : string
Результат string

getScheme() публичный Метод

Gets HTTP schema (http/https)
public getScheme ( ) : string
Результат string

getServer() публичный Метод

Gets variable from $_SERVER
public getServer ( string $name = null, mixed $defaultValue = null ) : mixed
$name string
$defaultValue mixed
Результат mixed

getUri() публичный Метод

test/test.jsp
public getUri ( ) : string
Результат string

getUrl() публичный Метод

http://localhost:8080/test/test.jsp
public getUrl ( boolean $withQuery = false ) : string
$withQuery boolean
Результат string

getUserAgent() публичный Метод

Gets HTTP user agent used to made the request
public getUserAgent ( ) : string
Результат string

has() публичный Метод

Checks whether $_SERVER has certain index
public has ( string $name ) : boolean
$name string
Результат boolean

hasFiles() публичный Метод

Checks whether request include attached files
public hasFiles ( boolean $onlySuccessful = false ) : boolean
$onlySuccessful boolean
Результат boolean

hasGet() публичный Метод

Checks whether $_GET has certain index
public hasGet ( string $name ) : boolean
$name string
Результат boolean

hasPost() публичный Метод

Checks whether $_POST has certain index
public hasPost ( string $name ) : boolean
$name string
Результат boolean

hasPut() публичный Метод

Checks whether has certain index
public hasPut ( string $name ) : boolean
$name string
Результат boolean

hasQuery() публичный Метод

Checks whether $_GET has certain index
public hasQuery ( string $name ) : boolean
$name string
Результат boolean

hasServer() публичный Метод

Checks whether $_GET has certain index
public hasServer ( string $name ) : boolean
$name string
Результат boolean

isAjax() публичный Метод

Checks whether request has been made using ajax. Checks if $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest'
public isAjax ( ) : boolean
Результат boolean

isDelete() публичный Метод

Checks whether HTTP method is DELETE. if $_SERVER['REQUEST_METHOD']=='DELETE'
public isDelete ( ) : boolean
Результат boolean

isGet() публичный Метод

Checks whether HTTP method is GET. if $_SERVER['REQUEST_METHOD']=='GET'
public isGet ( ) : boolean
Результат boolean

isHead() публичный Метод

Checks whether HTTP method is HEAD. if $_SERVER['REQUEST_METHOD']=='HEAD'
public isHead ( ) : boolean
Результат boolean

isOptions() публичный Метод

Checks whether HTTP method is OPTIONS. if $_SERVER['REQUEST_METHOD']=='OPTIONS'
public isOptions ( ) : boolean
Результат boolean

isPatch() публичный Метод

Checks whether HTTP method is PATCH. if $_SERVER['REQUEST_METHOD']=='PATCH'
public isPatch ( ) : boolean
Результат boolean

isPost() публичный Метод

Checks whether HTTP method is POST. if $_SERVER['REQUEST_METHOD']=='POST'
public isPost ( ) : boolean
Результат boolean

isPut() публичный Метод

Checks whether HTTP method is PUT. if $_SERVER['REQUEST_METHOD']=='PUT'
public isPut ( ) : boolean
Результат boolean

setClientAddress() публичный Метод

set the client address for getClientAddress method
public setClientAddress ( string | callable $address ) : static
$address string | callable
Результат static