PHPackages                             issei-m/streamed-csv-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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. issei-m/streamed-csv-response

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

issei-m/streamed-csv-response
=============================

Extends the Symfony\\Component\\HttpFoundation\\StreamedResponse to send a CSV file to client.

v1.1(9y ago)427.2k1MITPHPPHP &gt;=5.3.3

Since Jan 22Pushed 8y ago2 watchersCompare

[ Source](https://github.com/issei-m/StreamedCsvResponse)[ Packagist](https://packagist.org/packages/issei-m/streamed-csv-response)[ RSS](/packages/issei-m-streamed-csv-response/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

StreamedCsvResponse
===================

[](#streamedcsvresponse)

[![SensioLabsInsight](https://camo.githubusercontent.com/761fb554222297cd8bcebb5b40ba8e47c5ce087342a8ae61c2af3da1dca687ee/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62663438356538342d623236302d346534652d613735322d6539663866656131613862622f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/bf485e84-b260-4e4e-a752-e9f8fea1a8bb)

[![Build Status](https://camo.githubusercontent.com/edf8c463b7b48aa54923ea7b224234ea896de84c56a85dc90fabb04a78cffc6a/68747470733a2f2f7472617669732d63692e6f72672f69737365692d6d2f53747265616d6564437376526573706f6e73652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/issei-m/StreamedCsvResponse)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7ba6c88d3b065c9e237399f745214640b9abcbf0023b88c11d3f76136314c980/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f69737365692d6d2f53747265616d6564437376526573706f6e73652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/issei-m/StreamedCsvResponse/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/b6d67f1173e7cab675577d623d23cdd25edbb4c93800fe20e774ca581526d079/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f69737365692d6d2f53747265616d6564437376526573706f6e73652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/issei-m/StreamedCsvResponse/?branch=master)[![License](https://camo.githubusercontent.com/390d139188586e18946fbd7e24a0785c80c96ade0fc18edcb35435e3880dbdf3/68747470733a2f2f706f7365722e707567782e6f72672f69737365692d6d2f73747265616d65642d6373762d726573706f6e73652f6c6963656e73652e737667)](https://packagist.org/packages/issei-m/streamed-csv-response)

Extending the `Symfony\Component\HttpFoundation\StreamedResponse` to send a CSV file to client. It works with Symfony 2.7 and newer (including 3 and 4 of course) on PHP 7.x.

Usage
-----

[](#usage)

Very easy, just pass **two** arguments to the constructor. For instance in Symfony's controller:

```
public function exportCustomersAction(Request $request)
{
    return new StreamedCsvResponse(
        // 1st parameter: any iterable CSV rows
        (function () {
            yield ['Full Name', 'Email', 'Gender'];

            foreach ($this->get('user_repository')->getAllUsers() as $user) {
                yield [
                    $user->getFullName(),
                    $user->getEmail(),
                    $user->getGender(),
                ];
            }

            // Of course, you can also use any iterable for cell representation
            yield (function () {
                yield '村澤 逸生';
                yield 'issei.m7@gmail.com';
                yield '男性';
            })();
        })(),

        // 2nd parameter: the filename the browser uses in downloading
        'customers.csv'
    );
}
```

### auto encoding

[](#auto-encoding)

If the response has been set any `charset`, every cell content will be encoded accordingly when sending:

```
$response = new StreamedCsvResponse($rows, 'customers.csv');
$response->setCharset('SJIS-win');

$response->send(); // Every cells are automatically encoded to SJIS-win.
```

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

[](#installation)

Use [Composer](https://getcomposer.org) to install the package:

```
$ composer require issei-m/streamed-csv-response

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~281 days

Total

4

Last Release

3289d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15c23b5cac78ca616a9ba14846080f7115ec937160ef88b2a902e129b18cc1ea?d=identicon)[issei-m](/maintainers/issei-m)

---

Top Contributors

[![issei-m](https://avatars.githubusercontent.com/u/1135118?v=4)](https://github.com/issei-m "issei-m (61 commits)")[![tolean](https://avatars.githubusercontent.com/u/572258?v=4)](https://github.com/tolean "tolean (1 commits)")

---

Tags

csvlibrarypackagephpsymfonyresponsesymfonyexportcsvdownload

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/issei-m-streamed-csv-response/health.svg)

```
[![Health](https://phpackages.com/badges/issei-m-streamed-csv-response/health.svg)](https://phpackages.com/packages/issei-m-streamed-csv-response)
```

PHPackages © 2026

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