PHP Class Aerys\StandardResponse

Inheritance: implements aerys\Response
Afficher le fichier Open project: amphp/aerys

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
isValidHeaderField ( string $field ) : boolean
isValidHeaderValue ( string $value ) : boolean
isValidReasonPhrase ( string $phrase ) : boolean
setCookies ( )

Method Details

__construct() public méthode

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

__debugInfo() public méthode

public __debugInfo ( ) : array
Résultat array

addHeader() public méthode

{@inheritDoc}
public addHeader ( string $field, string $value ) : aerys\Response
$field string
$value string
Résultat aerys\Response

end() public méthode

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() public méthode

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() public méthode

{@inheritDoc}
public push ( string $url, array $headers = null ) : aerys\Response
$url string
$headers array
Résultat aerys\Response

setCookie() public méthode

{@inheritDoc}
public setCookie ( string $name, string $value, array $flags = [] ) : aerys\Response
$name string
$value string
$flags array
Résultat aerys\Response

setHeader() public méthode

{@inheritDoc}
public setHeader ( string $field, string $value ) : aerys\Response
$field string
$value string
Résultat aerys\Response

setReason() public méthode

{@inheritDoc}
public setReason ( string $phrase ) : aerys\Response
$phrase string
Résultat aerys\Response

setStatus() public méthode

{@inheritDoc}
public setStatus ( integer $code ) : aerys\Response
$code integer
Résultat aerys\Response

state() public méthode

{@inheritDoc}
public state ( ) : integer
Résultat integer

stream() public méthode

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
Résultat Amp\Promise to be succeeded whenever local buffers aren't full