PHPackages                             alexpts/psr15-middlewares - 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. alexpts/psr15-middlewares

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

alexpts/psr15-middlewares
=========================

Middlewares compatible with PSR-7 and PSR-15

2.1.0(3y ago)16.1k[1 PRs](https://github.com/alexpts/psr15-middlewares/pulls)1MITPHPPHP ~8.1CI failing

Since Mar 5Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/alexpts/psr15-middlewares)[ Packagist](https://packagist.org/packages/alexpts/psr15-middlewares)[ Docs](https://github.com/alexpts/psr15-middlewares)[ RSS](/packages/alexpts-psr15-middlewares/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (6)Versions (26)Used By (1)

psr15-middlewares
=================

[](#psr15-middlewares)

[![phpunit](https://github.com/alexpts/psr15-middlewares/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/alexpts/psr15-middlewares/actions/workflows/phpunit.yml)[![codecov](https://camo.githubusercontent.com/424a5094f2ad989ae33ff2f56e3b79b57990c6d42cc3898b6cda600515846fa0/68747470733a2f2f636f6465636f762e696f2f67682f616c65787074732f70737231352d6d6964646c6577617265732f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d31344c36494a41355545)](https://codecov.io/gh/alexpts/psr15-middlewares)

Collection of PSR-15 middlewares.

Middlewares compatible with [PSR-7](https://www.php-fig.org/psr/psr-7/) and [PSR-15](https://www.php-fig.org/psr/psr-15/)

Installation
------------

[](#installation)

`$ composer require alexpts/psr15-middlewares`

### ResponseTime

[](#responsetime)

### ResponseMemory

[](#responsememory)

### CORS ( =&gt; see StaticHeader)

[](#cors---see-staticheader)

### PoweredBy ( =&gt; see StaticHeader)

[](#poweredby---see-staticheader)

### isXHR

[](#isxhr)

### PhpInputToBody

[](#phpinputtobody)

### Etag

[](#etag)

### StaticHeader

[](#staticheader)

### StaticHeaderDefault

[](#staticheaderdefault)

### JsonPayload (need tests)

[](#jsonpayload-need-tests)

### RequestWithAttribute

[](#requestwithattribute)

### StaticResponse

[](#staticresponse)

### ThrowableHandler

[](#throwablehandler)

### HasRequestAttributeName (need tests)

[](#hasrequestattributename-need-tests)

### CallbackAdapter (need tests)

[](#callbackadapter-need-tests)

### LogError (need tests)

[](#logerror-need-tests)

### ErrorToJsonResponse (need tests)

[](#errortojsonresponse-need-tests)

### NewRelic (need tests)

[](#newrelic-need-tests)

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance54

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~70 days

Recently: every ~333 days

Total

23

Last Release

1446d ago

Major Versions

1.16.2 → 2.0.02020-11-30

PHP version history (4 changes)1.0.0PHP &gt;7.2

1.10.1PHP ~7.2

2.0.0PHP ~8.0

2.1.0PHP ~8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/31106536118e11bf9d0c9d7f467db5b534efa9c46ee76680b308f0c39d9a798c?d=identicon)[alexpts](/maintainers/alexpts)

---

Top Contributors

[![alexpts](https://avatars.githubusercontent.com/u/1306916?v=4)](https://github.com/alexpts "alexpts (55 commits)")

---

Tags

psr-7middlewarepsr-15

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexpts-psr15-middlewares/health.svg)

```
[![Health](https://phpackages.com/badges/alexpts-psr15-middlewares/health.svg)](https://phpackages.com/packages/alexpts-psr15-middlewares)
```

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[tuupola/slim-basic-auth

PSR-7 and PSR-15 HTTP Basic Authentication Middleware

4442.0M26](/packages/tuupola-slim-basic-auth)[relay/relay

A PSR-15 server request handler.

3302.1M86](/packages/relay-relay)[tuupola/cors-middleware

PSR-7 and PSR-15 CORS middleware

1331.8M24](/packages/tuupola-cors-middleware)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

586.6M81](/packages/laminas-laminas-stratigility)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)

PHPackages © 2026

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