Diff: https://github.com/zendframework/zend-diactoros/compare/1.1.4...1.3.3
ServerRequestFactory::marshalHeaders()
to no longer omit
Cookie
headers from the aggregated headers. While the values are parsed and
injected into the cookie params, it's useful to have access to the raw headers
as well.ServerRequest
constructor:array $cookies
array $queryParams
null|array|object $parsedBody
string $protocolVersion
ServerRequestFactory
was updated to pass values for each of these parameters
when creating an instance, instead of using the related with*()
methods on
an instance.ServerRequestFactory
to retrieve the HTTP protocol version and inject it in
the generated ServerRequest
, which previously was not performed.TextResponse
, HtmlResponse
,
and JsonResponse
); due to the fact that the constructor was not
rewinding the message body stream, getContents()
was thus returning null
,
as the pointer was at the end of the stream. The constructor now rewinds the
stream after populating it in the constructor.Zend\Diactoros\Response\SapiEmitterTrait
, which provides the following
private method definitions:injectContentLength()
emitStatusLine()
emitHeaders()
flush()
filterHeader()
The SapiEmitter
implementation has been updated to remove those methods and
instead compose the trait.SapiStreamEmitter
; this emitter type will
loop through the stream instead of emitting it in one go, and supports content
ranges.withHeader()
implementation to ensure that if the header existed previously
but using a different casing strategy, the previous version will be removed
in the cloned instance.Response
to ensure that null status codes are not possible.SapiEmitter
to emit a Content-Length
header with the content length as
reported by the response body stream, assuming that
StreamInterface::getSize()
returns an integer.Zend\Diactoros\Response\TextResponse
, for returning plain
text responses. By default, it sets the content type to text/plain;
charset=utf-8
; per the other response types, the signature is new
TextResponse($text, $status = 200, array $headers = [])
.Zend\Diactoros\CallbackStream
, allowing you to back a stream with a PHP
callable (such as a generator) to generate the message content. Its
constructor accepts the callable: $stream = new CallbackStream($callable);
HtmlResponse
to set the charset to utf-8 by default (if no content type
header is provided at instantiation).Please login to add feedback.
This update has been submitted for testing by siwinski.
This update has been pushed to testing.
This update has reached 14 days in testing and can be pushed to stable now if the maintainer wishes
This update has been submitted for stable by siwinski.
This update has been pushed to stable.