PHP 인터페이스 Aerys\Request

파일 보기 프로젝트 열기: amphp/aerys 0 사용 예제들

공개 메소드들

메소드 설명
getAllHeaders ( ) : array Retrieve an array of all headers in the message
getAllParams ( ) : array Retrieve an associative array of an array of query string values
getBody ( integer $bodySize ) : Body Retrieve the streaming request entity body.
getConnectionInfo ( ) : array Retrieve an associative array of extended information about the underlying connection
getCookie ( string $name ) : string | null Retrieve a cookie
getHeader ( string $field ) : string | null Retrieve the first occurrence of specified header in the message
getHeaderArray ( string $field ) : array Retrieve the specified header as an array of each of its occurrences in the request
getLocalVar ( string $key ) : mixed Retrieve a variable from the request's mutable local storage
getMethod ( ) : string Retrieve the HTTP method used to make this request
getOption ( string $option ) Retrieve a server option value
getParam ( string $name ) : string | null Retrieve one query string value of that name
getParamArray ( string $name ) : array Retrieve a array of query string values
getProtocolVersion ( ) : string Retrieve the HTTP protocol version number used by this request
getUri ( ) : string Retrieve the request URI in the form /some/resource/foo?bar=1&baz=2
setLocalVar ( string $key, mixed $value ) : void Assign a variable to the request's mutable local storage

메소드 상세

getAllHeaders() 공개 메소드

The returned array uses header names normalized to all-lowercase for simplified querying via isset().
public getAllHeaders ( ) : array
리턴 array

getAllParams() 공개 메소드

Retrieve an associative array of an array of query string values
public getAllParams ( ) : array
리턴 array

getBody() 공개 메소드

Note that the returned Body instance may change between calls, the contents not explicitly fetched through its valid() / consume() API, will be moved to the new instance though. No need to buffer and concatenate manually in this case.
public getBody ( integer $bodySize ) : Body
$bodySize integer maximum body size
리턴 Body

getConnectionInfo() 공개 메소드

Keys: - client_port - client_addr - server_port - server_addr - is_encrypted - crypto_info = [protocol, cipher_name, cipher_bits, cipher_version] If the underlying connection is not encrypted the crypto_info array is empty.
public getConnectionInfo ( ) : array
리턴 array

getCookie() 공개 메소드

Retrieve a cookie
public getCookie ( string $name ) : string | null
$name string
리턴 string | null

getHeader() 공개 메소드

If multiple headers were received for the specified field only the value of the first header is returned. Applications may use Request::getHeaderArray() to retrieve a list of all header values received for a given field. All header $field names are treated case-insensitively. A null return indicates the requested header field was not present.
public getHeader ( string $field ) : string | null
$field string
리턴 string | null

getHeaderArray() 공개 메소드

All header $field names are treated case-insensitively. An empty return array indicates that the header was not present in the request.
public getHeaderArray ( string $field ) : array
$field string
리턴 array

getLocalVar() 공개 메소드

Each request has its own mutable local storage to which application callables and middleware may read and write data. Other callables which are aware of this data can then access it without the server being tightly coupled to specific implementations.
public getLocalVar ( string $key ) : mixed
$key string
리턴 mixed

getMethod() 공개 메소드

Retrieve the HTTP method used to make this request
public getMethod ( ) : string
리턴 string

getOption() 공개 메소드

Retrieve a server option value
public getOption ( string $option )
$option string The option to retrieve

getParam() 공개 메소드

Retrieve one query string value of that name
public getParam ( string $name ) : string | null
$name string
리턴 string | null

getParamArray() 공개 메소드

Retrieve a array of query string values
public getParamArray ( string $name ) : array
$name string
리턴 array

getProtocolVersion() 공개 메소드

This method returns the HTTP protocol version (e.g. "1.0", "1.1", "2.0") in use; it has nothing to do with URI schemes like http:// or https:// ...
public getProtocolVersion ( ) : string
리턴 string

getUri() 공개 메소드

Retrieve the request URI in the form /some/resource/foo?bar=1&baz=2
public getUri ( ) : string
리턴 string

setLocalVar() 공개 메소드

Each request has its own mutable local storage to which application callables and middleware may read and write data. Other callables which are aware of this data can then access it without the server being tightly coupled to specific implementations.
public setLocalVar ( string $key, mixed $value ) : void
$key string
$value mixed
리턴 void