PHPackages                             struggle-for-php/sfp-diactoros-extension - 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. struggle-for-php/sfp-diactoros-extension

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

struggle-for-php/sfp-diactoros-extension
========================================

An extension for zend-diactoros.

0.1.0(10y ago)1161[1 PRs](https://github.com/struggle-for-php/sfp-diactoros-extension/pulls)BSD-3-ClausePHPPHP &gt;=5.5.0

Since Jun 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/struggle-for-php/sfp-diactoros-extension)[ Packagist](https://packagist.org/packages/struggle-for-php/sfp-diactoros-extension)[ RSS](/packages/struggle-for-php-sfp-diactoros-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

sfp-diactoros-extension
=======================

[](#sfp-diactoros-extension)

[![Build Status](https://camo.githubusercontent.com/df28426b2c379e1cdf4f68259bd6e17b08a3cbeb13f677a4a9ff57486d3d2fa2/68747470733a2f2f7472617669732d63692e6f72672f7374727567676c652d666f722d7068702f7366702d64696163746f726f732d657874656e73696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/struggle-for-php/sfp-diactoros-extension)

A extension for zend-diactoros.

Feature
-------

[](#feature)

`SfpDiactoros\Response\SwitchingEmitter` allows `fpassthru()` with `FpassthruInterface`.

just changed only in `emitBody()` from original `Zend\Diactoros\Response\SapiEmitter`.

```
// SapiEmitter
echo $response->getBody();
```

```
// SwitchingEmitter
if ($body instanceof FpassthruInterface) {
    $resource = $body->detach();
    if ($body instanceof RewindFpassthruInterface) {
        rewind($resource);
    }
    fpassthru($resource);
} else {
    echo $response->getBody();
}
```

Usage
-----

[](#usage)

```
use SfpDiactoros\Response\SwitchingEmitter;

$server = Server::createServer($app, $_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
$server->setEmitter(new SwitchingEmitter);
```

```
use SfpDiactoros\Stream\RewindFpassthruStream;

$fp = fopen('/tmp/bigsize', 'r');
$response->withBody(new RewindFpassthruStream($fp));
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

4000d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4eed2726ad1fce689a99672d965d8b4a387f030f08290e00708b66e4621139d2?d=identicon)[sasezaki](/maintainers/sasezaki)

---

Top Contributors

[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (19 commits)")

---

Tags

diactoroszend-diactoros

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/struggle-for-php-sfp-diactoros-extension/health.svg)

```
[![Health](https://phpackages.com/badges/struggle-for-php-sfp-diactoros-extension/health.svg)](https://phpackages.com/packages/struggle-for-php-sfp-diactoros-extension)
```

###  Alternatives

[http-interop/http-factory-diactoros

An HTTP Factory using Zend Diactoros

14221.3k11](/packages/http-interop-http-factory-diactoros)

PHPackages © 2026

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