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

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

middlewares/emitter
===================

Middleware to send a PSR-7 response using header() and echo

v1.1.0(1y ago)320.2k2MITPHPPHP ^7.2 || ^8.0CI failing

Since Aug 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/middlewares/emitter)[ Packagist](https://packagist.org/packages/middlewares/emitter)[ Docs](https://github.com/middlewares/emitter)[ RSS](/packages/middlewares-emitter/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)Dependencies (8)Versions (6)Used By (2)

middlewares/emitter
===================

[](#middlewaresemitter)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ef0be0f129b3fb2498052c011a35486a5f8afdf98d068176f11019feba9195d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6964646c6577617265732f656d69747465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/emitter)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Testing](https://github.com/middlewares/emitter/workflows/testing/badge.svg)](https://github.com/middlewares/emitter/workflows/testing/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/97f5fe71f645f7b9fc2b103012e717d07e1c82c4dce00975092d83931dfe5828/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6964646c6577617265732f656d69747465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/emitter)

Middleware to send (or emit) a PSR-7 response object using `header()` and `echo` and return the sent response. This middleware is intended to go at the top of the middleware stack in order to get the response generated by the inner middlewares and send to the browser.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2
- A [PSR-7 http library](https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations)
- A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)

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

[](#installation)

This package is installable and autoloadable via Composer as [middlewares/emitter](https://packagist.org/packages/middlewares/emitter).

```
composer require middlewares/emitter
```

Usage
-----

[](#usage)

```
Dispatcher::run([
    new Middlewares\Emitter(),
    // Here the rest of your middlewares
]);
```

### maxBufferLength

[](#maxbufferlength)

Maximum output buffering size for each iteration. By default is `8192` bytes.

```
$emitter = (new Middlewares\Emitter())->maxBufferLength(512);
```

---

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes and [CONTRIBUTING](CONTRIBUTING.md) for contributing details.

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance40

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~511 days

Total

5

Last Release

513d ago

PHP version history (2 changes)v1.0.0PHP ^7.2

v1.0.3PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e99df56b617f4af8cf0556a51a0ca20c7420104920c57d7e9eab093f92bb744f?d=identicon)[oscarotero](/maintainers/oscarotero)

![](https://www.gravatar.com/avatar/42e0d72f42eb7d84f67e20d28606da42e5a3248ca908b1eadb4366aafeae2561?d=identicon)[filisko](/maintainers/filisko)

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (10 commits)")[![filisko](https://avatars.githubusercontent.com/u/8798694?v=4)](https://github.com/filisko "filisko (2 commits)")

---

Tags

emitterhttpmiddlewarepsr-15httppsr-7middlewareserverpsr-15emitter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3973.9M133](/packages/mezzio-mezzio)[middlewares/request-handler

Middleware to execute request handlers

441.8M30](/packages/middlewares-request-handler)[middlewares/fast-route

Middleware to use FastRoute

95208.6k15](/packages/middlewares-fast-route)[middlewares/negotiation

Middleware to implement content negotiation

46466.5k14](/packages/middlewares-negotiation)[middlewares/http-authentication

Middleware to implement Basic and Digest Http authentication

34307.6k2](/packages/middlewares-http-authentication)[middlewares/client-ip

Middleware to detect the client ip and save it as a request attribute

16672.2k12](/packages/middlewares-client-ip)

PHPackages © 2026

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