PHP Класс Aerys\StandardResponse

Наследование: implements aerys\Response
Показать файл Открыть проект

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

Метод Описание
__construct ( Generator $codec, Client $client )
__debugInfo ( ) : array
addHeader ( string $field, string $value ) : aerys\Response {@inheritDoc}
end ( string $finalBody = null ) Signify the end of streaming response output
flush ( ) Request that any buffered data be flushed to the client
push ( string $url, array $headers = null ) : aerys\Response {@inheritDoc}
setCookie ( string $name, string $value, array $flags = [] ) : aerys\Response {@inheritDoc}
setHeader ( string $field, string $value ) : aerys\Response {@inheritDoc}
setReason ( string $phrase ) : aerys\Response {@inheritDoc}
setStatus ( integer $code ) : aerys\Response {@inheritDoc}
state ( ) : integer {@inheritDoc}
stream ( string $partialBody ) : Amp\Promise Stream partial entity body data

Приватные методы

Метод Описание
isValidHeaderField ( string $field ) : boolean
isValidHeaderValue ( string $value ) : boolean
isValidReasonPhrase ( string $phrase ) : boolean
setCookies ( )

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

__construct() публичный метод

public __construct ( Generator $codec, Client $client )
$codec Generator
$client Client

__debugInfo() публичный метод

public __debugInfo ( ) : array
Результат array

addHeader() публичный метод

{@inheritDoc}
public addHeader ( string $field, string $value ) : aerys\Response
$field string
$value string
Результат aerys\Response

end() публичный метод

User applications are NOT required to call Response::end() as the server will handle this automatically as needed. Passing the optional $finalBody is equivalent to the following: $response->stream($finalBody); $response->end();
public end ( string $finalBody = null )
$finalBody string Optional final body data to send

flush() публичный метод

This method only makes sense when streaming output via Response::stream(). Invoking it before calling stream() or after send()/end() is a logic error.
public flush ( )

push() публичный метод

{@inheritDoc}
public push ( string $url, array $headers = null ) : aerys\Response
$url string
$headers array
Результат aerys\Response

setCookie() публичный метод

{@inheritDoc}
public setCookie ( string $name, string $value, array $flags = [] ) : aerys\Response
$name string
$value string
$flags array
Результат aerys\Response

setHeader() публичный метод

{@inheritDoc}
public setHeader ( string $field, string $value ) : aerys\Response
$field string
$value string
Результат aerys\Response

setReason() публичный метод

{@inheritDoc}
public setReason ( string $phrase ) : aerys\Response
$phrase string
Результат aerys\Response

setStatus() публичный метод

{@inheritDoc}
public setStatus ( integer $code ) : aerys\Response
$code integer
Результат aerys\Response

state() публичный метод

{@inheritDoc}
public state ( ) : integer
Результат integer

stream() публичный метод

If response output has not yet started headers will also be sent when this method is invoked.
public stream ( string $partialBody ) : Amp\Promise
$partialBody string
Результат Amp\Promise to be succeeded whenever local buffers aren't full