PHPackages                             minetro/fly-response - 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. minetro/fly-response

Abandoned → [contributte/application](/?search=contributte%2Fapplication)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

minetro/fly-response
====================

FlyResponse to Nette Framework

v0.2(9y ago)62.5k1BSD-3-ClausePHPPHP &gt;= 5.5CI failing

Since Jul 8Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/contributte/fly-response)[ Packagist](https://packagist.org/packages/minetro/fly-response)[ Docs](https://github.com/minetro/fly-response)[ RSS](/packages/minetro-fly-response/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

[![](https://camo.githubusercontent.com/98c81f3ccc1d6136c06337ebcd89171d1434913ff797bec4755d4a0822fdf96e/68747470733a2f2f686561746261646765722e76657263656c2e6170702f6769746875622f726561646d652f636f6e74726962757474652f666c792d726573706f6e73652f3f646570726563617465643d31)](https://camo.githubusercontent.com/98c81f3ccc1d6136c06337ebcd89171d1434913ff797bec4755d4a0822fdf96e/68747470733a2f2f686561746261646765722e76657263656c2e6170702f6769746875622f726561646d652f636f6e74726962757474652f666c792d726573706f6e73652f3f646570726563617465643d31)

 [![](https://camo.githubusercontent.com/a8b1cd856d7d396fdebbe46947cc3507490acc267a02361e5e53bb7b820c95c3/68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f6769747465722f6379616e)](https://bit.ly/ctteg) [![](https://camo.githubusercontent.com/86d6416fc04f8bcc3daa7bf881526b9953b9726b1164d05c157c8713e3a73418/68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f666f72756d2f79656c6c6f77)](https://bit.ly/cttfo) [![](https://camo.githubusercontent.com/5d170ab94e6d594609561e16fe0f9e4293968fbd4dfcfafc5e11efc1415ef09c/68747470733a2f2f62616467656e2e6e65742f62616467652f73706f6e736f722f646f6e6174696f6e732f463936383534)](https://contributte.org/partners.html)

 Website 🚀 [contributte.org](https://contributte.org) | Contact 👨🏻‍💻 [f3l1x.io](https://f3l1x.io) | Twitter 🐦 [@contributte](https://twitter.com/contributte)

Disclaimer
----------

[](#disclaimer)

⚠️This project is no longer being maintained. Please use [contributte/application](https://github.com/contributte/application).Composer[`minetro/fly-response`](https://packagist.org/packages/minetro/fly-response)Version[![](https://camo.githubusercontent.com/4e4c20c266ea3eb6421622a0c90b9d7868ccd2ad07f89312982b1cc45a13e5a4/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f6d696e6574726f2f666c792d726573706f6e7365)](https://camo.githubusercontent.com/4e4c20c266ea3eb6421622a0c90b9d7868ccd2ad07f89312982b1cc45a13e5a4/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f6d696e6574726f2f666c792d726573706f6e7365)PHP[![](https://camo.githubusercontent.com/2088fd4ce709c944021c5b39c2ba5de7af2a69780eeeb494e0dc8a0c57c2577b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f6d696e6574726f2f666c792d726573706f6e7365)](https://camo.githubusercontent.com/2088fd4ce709c944021c5b39c2ba5de7af2a69780eeeb494e0dc8a0c57c2577b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f6d696e6574726f2f666c792d726573706f6e7365)License[![](https://camo.githubusercontent.com/72175b14eb4bad671482febd0b828785968f873e4f072bee557df61c4d65e783/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f636f6e74726962757474652f666c792d726573706f6e7365)](https://camo.githubusercontent.com/72175b14eb4bad671482febd0b828785968f873e4f072bee557df61c4d65e783/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f636f6e74726962757474652f666c792d726573706f6e7365)Documentation
-------------

[](#documentation)

### Usage

[](#usage)

#### Responses

[](#responses)

##### FlyResponse

[](#flyresponse)

For common purpose and your custom solutions.

##### FlyFileResponse

[](#flyfileresponse)

Special response for handling files on-the-fly.

#### Adapters

[](#adapters)

##### ProcessAdapter

[](#processadapter)

Execute command over [popen](http://php.net/manual/en/function.popen.php).

```
use Minetro\FlyResponse\Adapter\ProcessAdapter;
use Minetro\FlyResponse\FlyFileResponse;

// Compress current folder and send to response
$adapter = new ProcessAdapter('tar cf - ./ | gzip -c -f');
$response = new FlyFileResponse($adapter, 'folder.tgz');

$this->sendResponse($response);
```

##### StdoutAdapter

[](#stdoutadapter)

Write to `php://output`.

```
use Minetro\FlyResponse\Adapter\StdoutAdapter;
use Minetro\FlyResponse\Buffer\Buffer;
use Minetro\FlyResponse\FlyFileResponse;
use Nette\Http\IRequest;
use Nette\Http\IResponse;

// Write to stdout over buffer class
$adapter = new StdoutAdapter(function(Buffer $buffer, IRequest $request, IResponse $response) {
	// Modify headers
	$response->setHeader(..);

	// Write data
	$buffer->write('Some data..');
});
$response = new FlyFileResponse($adapter, 'my.data');

$this->sendResponse($response);
```

##### CallbackAdapter

[](#callbackadapter)

```
use Minetro\FlyResponse\Adapter\CallbackAdapter;
use Minetro\FlyResponse\Buffer\Buffer;
use Minetro\FlyResponse\FlyFileResponse;
use Nette\Http\IRequest;
use Nette\Http\IResponse;

$adapter = new CallbackAdapter(function(IRequest $request, IResponse $response) use ($model) {
	// Modify headers
	$response->setHeader($header);

	// Fetch topsecret data
	$data = $this->facade->getData();
	foreach ($data as $d) {
		// Write or print data..
	}
});
$response = new FlyFileResponse($adapter, 'my.data');

$this->sendResponse($response);
```

#### Model

[](#model)

```
final class BigOperationHandler
{

	/** @var Facade */
	private $facade;

	/**
	 * @param Facade $facade
	 */
	public function __construct(Facade $facade)
	{
		$this->facade = $facade;
	}

	public function toFlyResponse()
	{
		$adapter = new CallbackAdapter(function (IRequest $request, IResponse $response) {
			// Modify headers
			$response->setHeader(..);

			// Fetch topsecret data
			$data = $this->facade->getData();
			foreach ($data as $d) {
				// Write or print data..
			}
		});

		return new FlyFileResponse($adapter, 'file.ext');

		// or
		return new FlyResponse($adapter);
	}
}

interface IBigOperationHandlerFactory
{

	/**
	 * @return BigOperationHandler
	 */
	public function create();

}

final class MyPresenter extends Nette\Application\UI\Presenter
{

	/** @var IBigOperationHandlerFactory @inject */
	public $bigOperationHandlerFactory;

	public function handleMagic()
	{
		$this->sendResponse(
			$this->bigOperationHandlerFactory->create()->toFlyResponse()
		);
	}
}
```

Development
-----------

[](#development)

This package was maintain by these authors.

[ ![](https://avatars2.githubusercontent.com/u/538058?v=3&s=80)](https://github.com/f3l1x)---

Consider to [support](https://contributte.org/partners.html) **contributte** development team. Also thank you for using this package.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance49

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~10 days

Total

2

Last Release

3588d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/538058?v=4)[Milan Šulc](/maintainers/f3l1x)[@f3l1x](https://github.com/f3l1x)

---

Top Contributors

[![f3l1x](https://avatars.githubusercontent.com/u/538058?v=4)](https://github.com/f3l1x "f3l1x (20 commits)")[![petrparolek](https://avatars.githubusercontent.com/u/6066243?v=4)](https://github.com/petrparolek "petrparolek (4 commits)")[![Daaarkling](https://avatars.githubusercontent.com/u/10207494?v=4)](https://github.com/Daaarkling "Daaarkling (1 commits)")

---

Tags

contributtecurlhttpnette-frameworkphp

### Embed Badge

![Health badge](/badges/minetro-fly-response/health.svg)

```
[![Health](https://phpackages.com/badges/minetro-fly-response/health.svg)](https://phpackages.com/packages/minetro-fly-response)
```

###  Alternatives

[nette/routing

Nette Routing: two-ways URL conversion

25712.0M22](/packages/nette-routing)[contributte/api-router

RESTful Router for your Apis in Nette Framework - created either directly or via attributes

20802.8k3](/packages/contributte-api-router)[contributte/api

Powerful, documented, validated, built-in API to Nette Framework (@nette)

10684.3k](/packages/contributte-api)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)[kdyby/fake-session

FakeSession class for Nette Framework

11354.8k7](/packages/kdyby-fake-session)

PHPackages © 2026

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