Download the PHP package dmt-software/aura-web-psr without Composer
On this page you can find all versions of the php package dmt-software/aura-web-psr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dmt-software/aura-web-psr
More information about dmt-software/aura-web-psr
Files in dmt-software/aura-web-psr
Package aura-web-psr
Short Description PSR-7 wrapper for Aura.Web implementations
License MIT
Informations about the package aura-web-psr
Aura Web PSR-7 wrapper
Introduction
Aura.Web implementations do not follow PSR-7, the recommendation for HTTP messages. As more and more packages that solve common HTTP message problems do implement this recommendation, it would be nice if these can be used for Aura.Web implementations too. This package will allow you to start implementing PSR-7 without changing the library underneath, preserving the current code usage 1 to make migration or refactoring easier.
Installation
Although Aura.Web still supports down to PHP 5.3, this package needs PHP 7.0 or higher. Older implementations need to migrate to PHP 7 before this package can be used. I would suggest to use rector/rector to make this upgrade a more simple task.
Using composer
Usage
Creating a ServerRequest
Handling uploaded files
Creating a Response
Usage during migration
Wrapped objects
All PSR-7 http-messages wrap an Aura.Web object. According to their responsibility this can be any of the request or
response objects. These objects can be retrieved by calling the getInnerObject()
method on the http-message.
Immutability
Changes to the http-messages will be internally tracked by the wrapped objects, but in such a way that the immutability of the message is preserved. This means each change that is made to a message object will return a new Aura.Web object instance.
Make sure each time a http-message is changed, the aura request must be retrieved from the new message instance too.
Incompatibility
Some build in solutions, like uploading files, receiving a json post, etc are not available when this package is used. For an overview of how to cope with these discrepancies see the compatibility documentation.
That http-messages use (a part of) the Aura.Web objects does not mean it is true the other way around. Some aura objects are not managed by the http-messages. For managing these objects one can fallback to the original code (once the inner object is retrieved) or use/write some additional code that works similar. See the workarounds documentation for tips and tricks on this subject.
All versions of aura-web-psr with dependencies
aura/web Version ^2.1
psr/http-factory Version ^1.0
psr/http-message Version ^1.0