All notable changes to this project will be documented in this file, in reverse chronological order by release..
Updated component to psr/http-message 0.4.0. That release contains a number of backwards-incompatible changes.
- Added IncomingRequestFactory::setHeaders() for simplifying setting (overwriting) many headers at once from an array.
- Updated MessageTrait::addHeader() to allow array values
- Modified IncomingRequest to
s/PathParams/Attributes/g
- IncomingRequest now only allows arrays for either input or return values; Array-like objects are no longer accepted.
- Removed ability to pass objects to MessageTrait::addHeader()/setHeader()
- Removed setHeaders()/addHeaders() from MessageTrait
- Modified IncomingRequest to
s/PathParams/Attributes/g
- Removed ability to pass objects to MessageTrait::addHeader()/setHeader()
- Removed setHeaders()/addHeaders() from MessageTrait
- Modified IncomingRequest to
s/PathParams/Attributes/g
- #11 Moved
PhlyTestautoloader configuration toautoload-devkey, as it is needed for development purposes only.
This release has some backwards incompatible breaks, including:
Phly\Http\Requestno longer accepts an HTTP protocol version as a constructor argument. UsesetProtocolVersion()instead.Phly\Http\Requestnow usesphp://memoryas the default body stream. (IncomingRequestusesphp://inputas the default stream.)Phly\Http\RequestFactoryhas been renamed toPhly\Http\IncomingRequestFactory- It also now expects an
IncomingRequestInterfaceif passed a request object to populate.
- It also now expects an
Phly\Http\Server::createServer()now expects 4 additional arguments:$query, usually$_GET$body, usually$_POST$cookies, usually$_COOKIE$files, usually$_FILES
Phly\Http\Servernow composes aPsr\Http\Message\IncomingRequestInterfaceinstance, not aPsr\Http\Message\RequestInterfaceinstance. This has the implication that all handlers will now receive more specifically anIncomingRequest. The change affects each of the following method signatures:__construct()createServer()createServerFromRequest()
Phly\Http\MessageTrait::setProtocolVersion($version), per changes in PSR-7 (this is now defined in theMessageInterface).- Note in
Phly\Http\Stream::read()'s@returnannotation indicating that it can also return booleanfalse. Phly\Http\IncomingRequest, which implementsPsr\Http\Message\IncomingRequestInterfaceand provides a server-side request implementation with accessors for each type of request datum typically accessed (cookies, matched path parameters, query string arguments, body parameters, and upload file information). It usesphp://inputas the default body stream.Phly\Http\IncomingRequestFactory(which replacesPhly\Http\RequestFactory)fromGlobals($server, $query, $body, $cookies, $files)factory method for creating anIncomingRequestinstance from superglobals; all arguments are optional, and, if not provided, will be derived from the relevant superglobal.
Phly\Http\Server::createServer()now expects 4 additional arguments:$query, usually$_GET$body, usually$_POST$cookies, usually$_COOKIE$files, usually$_FILES
Phly\Http\Requestno longer accepts an HTTP protocol version as a constructor argument. UsesetProtocolVersion()instead.Phly\Http\Serverno longer works with standardPsr\Http\Message\RequestInterfaceimplementations; it requiresPsr\Http\Message\IncomingRequestInterfaceimplementations.
Phly\Http\RequestFactory(it is nowPhly\Http\IncomingRequestFactory)
Phly\Http\Stream::read()now returns boolean false when the stream is not readable, or no resource is present.
- Ability for header values to allow objects that can be cast to strings. This allows for header objects representing complex values to generate the value.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #8 Update README.md to remove references to methods and interfaces that have been removed.
- Updated README.md to reference
~0.2.0@devas the psr/http-message version when installing via Composer.
- Nothing.
- Nothing.
- Nothing.
- Updated implementation to psr/http-message 0.2.0, which:
- Renames StreamInterface to StreamableInterface
- Adds attach() and getMetadata($key = null) to the stream interface
- Removes the $maxLength argument from the getContents() method of the stream interface
- Nothing.
- Nothing.
- Nothing.
- Pinned to 0.1.0 of psr/http-message; v0.2.0 introduces breaking changes, which will require updates to this library before we can consume them.
- Nothing.
- Nothing.
- Nothing.
- #5
Phly\Http\Server::sendHeadersnow always sends multiple header lines if a header has multiple values.
- Nothing.
- Nothing.
- Nothing.
Phly\Http\Urinow importsInvalidArgumentException.
Adds a php://input-specific stream implementation to ensure it's always regarded as read-only, and to implement caching.
Phly\Http\PhpInputStream
- Nothing.
- Nothing.
Phly\Http\Requestnow creates aPhly\Http\PhpInputStreamby default.
Reworks the implementation to strictly follow the PSR HTTP message interfaces. This includes:
- Removing property overloading from the request implementation.
- Removing
Phly\Http\ResponseInterface, and the related method implementations in the concrete response implementation.
The removed features can be added via decoration or implementing additional interfaces in individual projects using the implementations.
Phly\Http\MessageTrait(implementsPsr\Http\Message\MessageInterface).
Phly\Http\ResponseInterface
Phly\Http\AbstractMessage(usePhly\Http\MessageTraitnow).Phly\Http\ResponseInterface.- Methods in
Phly\Http\Responsethat implementedPhly\Http\ResponseInterface. - Property overloading in
Phly\Http\RequestInterface.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- #1 fixes an issue where
%symbols could raise errors and result in no output. This was due to usingprintfto emit output, which was chosen for testing reasons; however, this had the aforementioned side effect. Tests were updated to use PHPUnit'sexpectOutputString()method for testing output, andServer::send()was modified to useechoinstead ofprintf().
Initial release.