PHPackages                             h4cc/stack-psr7-bridge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. h4cc/stack-psr7-bridge

ActiveLibrary[HTTP &amp; Networking](/categories/http)

h4cc/stack-psr7-bridge
======================

StackPHP Middleware for converting Symfony Http abstractions to PSR-7 and back.

v0.1(10y ago)1599MITPHPPHP &gt;=5.4.0

Since Jun 8Pushed 10y ago2 watchersCompare

[ Source](https://github.com/h4cc/stack-psr7-bridge)[ Packagist](https://packagist.org/packages/h4cc/stack-psr7-bridge)[ RSS](/packages/h4cc-stack-psr7-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

h4cc/stack-psr7-bridge
======================

[](#h4ccstack-psr7-bridge)

[StackPHP](http://stackphp.com/) Middleware for using [Symfony HttpKernel](http://symfony.com/doc/current/components/http_kernel/introduction.html) Applications and [PSR-7](https://github.com/php-fig/http-message) Application transparent.

[![Build Status](https://camo.githubusercontent.com/10b9a69e4865ae7c748e977f6eb9df184e51313a4807432d026a6cc022e00217/68747470733a2f2f7472617669732d63692e6f72672f683463632f737461636b2d707372372d6272696467652e737667)](https://travis-ci.org/h4cc/stack-psr7-bridge)[![HHVM Status](https://camo.githubusercontent.com/776a6938ca26820f4800be9668c54914ee6b9c1a39bd69e9407157319e07dbc6/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f683463632f737461636b2d707372372d6272696467652e737667)](http://hhvm.h4cc.de/package/h4cc/stack-psr7-bridge)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a9e4e0bd792b588a7ecf390040e3b4360cd2a37e1bddf3d7df2744bc1a304f9e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f683463632f737461636b2d707372372d6272696467652f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/h4cc/stack-psr7-bridge/)[![Code Coverage](https://camo.githubusercontent.com/62b641a6b77f6ec0622c29bb1cc68b3d3b9f02138641be5d85336599a6144abe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f683463632f737461636b2d707372372d6272696467652f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/h4cc/stack-psr7-bridge/)

This Middleware tries to make using Symfony HttpKernel Application and PSR-7 as easy as possible.

Wrapped applications can be:

- Any Symfony HttpKernel
- Any Callback expecting `function(RequestInterface $request, ResponseInterface $response, $next = null)`

It does not matter what kind of application is wrapped, the bridge will convert incoming requests and outgoing responses accordingly to the used interface.

The implementation this middleware is based on is .

Usage
-----

[](#usage)

By default, the Symfony HttpFoundation and HttpKernel are used. For PSR-7, the [Zend-Diactoros](https://github.com/zendframework/zend-diactoros) implementation is used. These implementations can be changed if needed.

### Wrapping a HttpKernel

[](#wrapping-a-httpkernel)

```
