Emits a Response to the PHP Server API.
This emitter offers a few changes from the emitters offered by diactoros:
Loops through the output buffer, flushing each, before emitting the response.
Parse content-range header https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
emit( Psr\Http\Message\ResponseInterface $response , $maxBufferLength 8192 )
emitBody( Psr\Http\Message\ResponseInterface $response , integer $maxBufferLength )
Emit the message body.
$response $maxBufferLength emitBodyRange( array $range , Psr\Http\Message\ResponseInterface $response , integer $maxBufferLength )
Emit a range of the message body.
$range $response $maxBufferLength emitCookies( array $cookies )
Emit cookies using setcookie()
$cookies emitHeaders( Psr\Http\Message\ResponseInterface $response )
Emit response headers.
Loops through each header, emitting each; if the header value is an array with multiple values, ensures that each is sent in such a way as to create aggregate headers (instead of replace the previous).
$response emitStatusLine( Psr\Http\Message\ResponseInterface $response )
Emit the status line.
Emits the status line using the protocol version and status code from the response; if a reason phrase is available, it, too, is emitted.
$response flush( integer|null $maxBufferLevel null )
Loops through the output buffer, flushing each, before emitting the response.
$maxBufferLevel optional null parseContentRange( string $header )
Parse content-range header https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
$header [unit, first, last, length]; returns false if no content range or an invalid content range is provided
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.4/class-Cake.Http.ResponseEmitter.html