PHP Класс Cake\Http\ResponseEmitter

This emitter offers a few changes from the emitters offered by diactoros: - It logs headers sent using CakePHP's logging tools. - Cookies are emitted using setcookie() to not conflict with ext/session
Наследование: implements Zend\Diactoros\Response\EmitterInterface
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
emit ( Psr\Http\Message\ResponseInterface $response, $maxBufferLength = 8192 ) {@inheritDoc}

Защищенные методы

Метод Описание
emitBody ( Psr\Http\Message\ResponseInterface $response, integer $maxBufferLength ) : void Emit the message body.
emitBodyRange ( array $range, Psr\Http\Message\ResponseInterface $response, integer $maxBufferLength ) : void Emit a range of the message body.
emitCookies ( array $cookies ) : void Emit cookies using setcookie()
emitHeaders ( Psr\Http\Message\ResponseInterface $response ) : void Emit response headers.
emitStatusLine ( Psr\Http\Message\ResponseInterface $response ) : void Emit the status line.
flush ( integer | null $maxBufferLevel = null ) : void Loops through the output buffer, flushing each, before emitting the response.
parseContentRange ( string $header ) : false | array Parse content-range header http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16

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

emit() публичный Метод

{@inheritDoc}
public emit ( Psr\Http\Message\ResponseInterface $response, $maxBufferLength = 8192 )
$response Psr\Http\Message\ResponseInterface

emitBody() защищенный Метод

Emit the message body.
protected emitBody ( Psr\Http\Message\ResponseInterface $response, integer $maxBufferLength ) : void
$response Psr\Http\Message\ResponseInterface The response to emit
$maxBufferLength integer The chunk size to emit
Результат void

emitBodyRange() защищенный Метод

Emit a range of the message body.
protected emitBodyRange ( array $range, Psr\Http\Message\ResponseInterface $response, integer $maxBufferLength ) : void
$range array The range data to emit
$response Psr\Http\Message\ResponseInterface The response to emit
$maxBufferLength integer The chunk size to emit
Результат void

emitCookies() защищенный Метод

Emit cookies using setcookie()
protected emitCookies ( array $cookies ) : void
$cookies array An array of Set-Cookie headers.
Результат void

emitHeaders() защищенный Метод

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).
protected emitHeaders ( Psr\Http\Message\ResponseInterface $response ) : void
$response Psr\Http\Message\ResponseInterface The response to emit
Результат void

emitStatusLine() защищенный Метод

Emits the status line using the protocol version and status code from the response; if a reason phrase is availble, it, too, is emitted.
protected emitStatusLine ( Psr\Http\Message\ResponseInterface $response ) : void
$response Psr\Http\Message\ResponseInterface The response to emit
Результат void

flush() защищенный Метод

Loops through the output buffer, flushing each, before emitting the response.
protected flush ( integer | null $maxBufferLevel = null ) : void
$maxBufferLevel integer | null Flush up to this buffer level.
Результат void

parseContentRange() защищенный Метод

Parse content-range header http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
protected parseContentRange ( string $header ) : false | array
$header string The Content-Range header to parse.
Результат false | array [unit, first, last, length]; returns false if no content range or an invalid content range is provided