PHP 클래스 ManaPHP\Http\Request

상속: extends ManaPHP\Component, implements ManaPHP\Http\RequestInterface
파일 보기 프로젝트 열기: manaphp/manaphp

보호된 프로퍼티들

프로퍼티 타입 설명
$_clientAddress string
$_putCache array
$_rawBody string

공개 메소드들

메소드 설명
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 possible client IPv4 Address. This method search in $_SERVER['REMOTE_ADDR'] and optionally in $_SERVER['HTTP_X_FORWARDED_FOR']
getFiles ( boolean $onlySuccessful = false ) : File[] Gets attached files as \ManaPHP\Http\Request\File instances
getGet ( string $name = null, string $rule = null, mixed $defaultValue = null ) : mixed Gets variable from $_GET applying filters if needed If no parameters are given the $_GET is returned
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 If no parameters are given the $_POST is returned
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 If no parameters are given the $_GET is returned
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
getUrl ( boolean $withQuery = false ) : string
getUserAgent ( ) : string Gets HTTP user agent used to made the request
has ( string $name ) : boolean Checks whether $_REQUEST has certain index
hasFiles ( boolean $onlySuccessful = false ) : boolean Checks whether request includes attached files http://php.net/manual/en/features.file-upload.multiple.php
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 put 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

보호된 메소드들

메소드 설명
_getHelper ( array $source, string $name = null, string $rule = null, mixed $defaultValue = null ) : string | null

메소드 상세

_getHelper() 보호된 메소드

protected _getHelper ( array $source, string $name = null, string $rule = null, mixed $defaultValue = null ) : string | null
$source array
$name string
$rule string
$defaultValue mixed
리턴 string | null

get() 공개 메소드

If no parameters are given the $_REQUEST is returned Returns value from $_REQUEST["user_email"] without sanitizing $userEmail = $request->get("user_email"); Returns value from $_REQUEST["user_email"] with sanitizing $userEmail = $request->get("user_email", "email");
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 possible client IPv4 Address. This method 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\File instances
public getFiles ( boolean $onlySuccessful = false ) : File[]
$onlySuccessful boolean
리턴 ManaPHP\Http\Request\File[]

getGet() 공개 메소드

Returns value from $_GET["id"] without sanitizing $id = $request->getGet("id"); Returns value from $_GET["id"] with sanitizing $id = $request->getGet("id", "int"); Returns value from $_GET["id"] with a default value $id = $request->getGet("id", null, 150);
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() 공개 메소드

Returns value from $_POST["user_email"] without sanitizing $userEmail = $request->getPost("user_email"); Returns value from $_POST["user_email"] with sanitizing $userEmail = $request->getPost("user_email", "email");
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() 공개 메소드

Returns value from $_GET["id"] without sanitizing $id = $request->getQuery("id"); Returns value from $_GET["id"] with sanitizing $id = $request->getQuery("id", "int"); Returns value from $_GET["id"] with a default value $id = $request->getQuery("id", null, 150);
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() 공개 메소드

public getUri ( ) : string
리턴 string

getUrl() 공개 메소드

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 $_REQUEST has certain index
public has ( string $name ) : boolean
$name string
리턴 boolean

hasFiles() 공개 메소드

Checks whether request includes attached files http://php.net/manual/en/features.file-upload.multiple.php
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 put 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

프로퍼티 상세

$_clientAddress 보호되어 있는 프로퍼티

protected string $_clientAddress
리턴 string

$_putCache 보호되어 있는 프로퍼티

protected array $_putCache
리턴 array

$_rawBody 보호되어 있는 프로퍼티

protected string $_rawBody
리턴 string