PHPackages                             php-pm/psr7-adapter - 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. php-pm/psr7-adapter

AbandonedArchivedLibrary

php-pm/psr7-adapter
===================

A PSR-7 middleware bridge for PHP-PM

275283[1 issues](https://github.com/php-pm/php-pm-psr7/issues)PHP

Since Nov 30Pushed 8y ago4 watchersCompare

[ Source](https://github.com/php-pm/php-pm-psr7)[ Packagist](https://packagist.org/packages/php-pm/psr7-adapter)[ RSS](/packages/php-pm-psr7-adapter/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

**\[OBSOLETE\] PSR-7 compatibility is now built into [php-pm](https://github.com/php-pm/php-pm) directly.**

PHP-PM PSR-7 Adapter
====================

[](#php-pm-psr-7-adapter)

[PSR-7](http://www.php-fig.org/psr/psr-7/) adapter for use of PSR-7 middleware applications with PHP-PM. See .

Setup
-----

[](#setup)

```
composer require php-pm/psr7-adapter

```

Usage
-----

[](#usage)

PPM bootstraps your application once, and then passes all incoming requests to this instance. This instance needs to be a PSR-7 compatible interface, which means it needs to implement the following interface:

```
public function __invoke($request, $response, $next = null)
```

So, to be compatible with this adapter, you need to implement a class that, when instantiated, sets up your application, and implements the `__invoke` method as described above.

For example, if you use Zend's [Stratigility library](https://github.com/zendframework/zend-stratigility), your bootstrapper could look like this:

```
namespace Your\App;

use Zend\Stratigility\MiddlewarePipe;

class Middleware
{
    protected $pipe;

    public function __construct()
    {
        // Set up the application

        $this->pipe = new MiddlewarePipe;

        $this->pipe->pipe(new MyFirstMiddleware);
        $this->pipe->pipe(new MySecondMiddleware);
        $this->pipe->pipe(new MyThirdMiddleware);
    }

    public function __invoke($request, $response, $next = null)
    {
        $middleware = $this->pipe;
        return $middleware($request, $response, $next);
    }
}
```

### Starting the server

[](#starting-the-server)

When starting PPM, pass your middleware as the bootstrapper:

```
vendor/bin/ppm start --bridge=PHPPM\\Psr7\\Psr7Bridge --bootstrap=Your\\App\\Middleware

```

Alternatively, first configure PPM to use these options by default, and then start it directly:

```
vendor/bin/ppm config --bridge=PHPPM\\Psr7\\Psr7Bridge --bootstrap=Your\\App\\Middleware
vendor/bin/ppm start

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/974147f78bc18a1b3838b2959678bab84bb15ce12b79ecb638c8444ff05bf3c3?d=identicon)[MArcJ](/maintainers/MArcJ)

![](https://www.gravatar.com/avatar/8a8620604a1f4094fee4ab1c3d2f6fccb6583293daf5f866c804d155c05b2e13?d=identicon)[franzliedke](/maintainers/franzliedke)

---

Top Contributors

[![franzliedke](https://avatars.githubusercontent.com/u/249125?v=4)](https://github.com/franzliedke "franzliedke (18 commits)")[![maciejmrozinski](https://avatars.githubusercontent.com/u/1927895?v=4)](https://github.com/maciejmrozinski "maciejmrozinski (3 commits)")[![marcj](https://avatars.githubusercontent.com/u/450980?v=4)](https://github.com/marcj "marcj (2 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (2 commits)")

### Embed Badge

![Health badge](/badges/php-pm-psr7-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/php-pm-psr7-adapter/health.svg)](https://phpackages.com/packages/php-pm-psr7-adapter)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
