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
PhlyTest
autoloader configuration toautoload-dev
key, 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\Request
no longer accepts an HTTP protocol version as a constructor argument. UsesetProtocolVersion()
instead.Phly\Http\Request
now usesphp://memory
as the default body stream. (IncomingRequest
usesphp://input
as the default stream.)Phly\Http\RequestFactory
has been renamed toPhly\Http\IncomingRequestFactory
- It also now expects an
IncomingRequestInterface
if 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\Server
now composes aPsr\Http\Message\IncomingRequestInterface
instance, not aPsr\Http\Message\RequestInterface
instance. 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@return
annotation indicating that it can also return booleanfalse
. Phly\Http\IncomingRequest
, which implementsPsr\Http\Message\IncomingRequestInterface
and 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://input
as the default body stream.Phly\Http\IncomingRequestFactory
(which replacesPhly\Http\RequestFactory
)fromGlobals($server, $query, $body, $cookies, $files)
factory method for creating anIncomingRequest
instance 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\Request
no longer accepts an HTTP protocol version as a constructor argument. UsesetProtocolVersion()
instead.Phly\Http\Server
no longer works with standardPsr\Http\Message\RequestInterface
implementations; it requiresPsr\Http\Message\IncomingRequestInterface
implementations.
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.