This repository was archived by the owner on Aug 17, 2025. It is now read-only.
Releases: phly/http
Releases · phly/http
phly/http 0.6.0
Updated component to psr/http-message 0.4.0. That release contains a number of backwards-incompatible changes.
Added
- 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
Deprecated
- 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
- Removed ability to pass objects to MessageTrait::addHeader()/setHeader()
- Removed setHeaders()/addHeaders() from MessageTrait
- Modified IncomingRequest to
s/PathParams/Attributes/g
Fixed
- #11 Moved
PhlyTestautoloader configuration toautoload-devkey, as it is needed for development purposes only.
phly/http 0.5.0
This release updates phly/http to make it compatible with psr/http-message 0.3.0.
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()
Added
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
Deprecated
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.
Removed
Phly\Http\RequestFactory(it is nowPhly\Http\IncomingRequestFactory)
Fixed
Phly\Http\Stream::read()now returns boolean false when the stream is not readable, or no resource is present.