Download the PHP package brnc/psr7-symfony1-adapter without Composer
On this page you can find all versions of the php package brnc/psr7-symfony1-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package psr7-symfony1-adapter
Partial PSR-7 Adapters for Symfony 1.5
To enable the use of future-proof PSR-15 middlewares via partial PSR-7 adapters.
Quickstart
ServerRequest
Please mind the following PSR-7 violation which is enabled by default:
No immutability by default
as this is just an adapter for \sfWebRequest
which cannot easily be replaced with another instance.
This adapter – by default – also returns the very same instance when calling with*()
methods. For the same reason calls to methods which cannot act on and alter the underlying \sfWebRequest
will throw an \brnc\Symfony1\Message\Exception\LogicException
.
This default behaviour can be changed by creating the Request
using the Request::OPTION_IMMUTABLE_VIOLATION
option set to false
. The Request
-adapter will then always return new instances when with*()
-methods are called and won't throw exceptions on calls which cannot transparently act on the \sfWebRequest
- object.
Response
Please mind the default to mutability!
Pass it down to a PSR-15 sub-stack
You may use the ResponseFactory
implementing \Psr\Http\Message\ResponseFactoryInterface
in order to "spawn" responses within your PSR-15 sub-stack.
Manually transcribe a PSR-7 Response to Symfony1
Assume you couldn't use other means, and you're confronted with an arbitrary PSR-7 response you can use the ResponseTranscriptor
to copy the data from your PSR-7 response to your \sfWebResponse
.
Currently the ResponseTranscriptor
doesn't support cookies, and will fail fast and hard if it encounters some. You are free to implement your own Cookie-Handler implementing CookieTranscriptorInterface
and pass it as an optional constructor argument
Pass it down to http-foundation i.e. present-day Symfony
Combine this PSR7-Symfony1 Adapter and symfony/psr-http-message-bridge
to connect your Symfony1 stack via PSR-7 to symfony/http-foundation
objects and leverage using embedded (present-day) Symfony components.
All versions of psr7-symfony1-adapter with dependencies
guzzlehttp/psr7 Version ^1.9.1 || ^2.4.5
psr/http-factory Version ^1.0
webmozart/assert Version ^1.10