{"id":28419180,"url":"https://github.com/yiisoft/psr-emitter","last_synced_at":"2025-06-26T09:30:58.753Z","repository":{"id":293286083,"uuid":"983489459","full_name":"yiisoft/psr-emitter","owner":"yiisoft","description":"PSR-7 HTTP response emitter","archived":false,"fork":false,"pushed_at":"2025-05-21T13:07:50.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-06-10T05:28:44.582Z","etag":null,"topics":["emitter","http","psr","psr-7","yii3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiisoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"yiisoft","github":["yiisoft"]}},"created_at":"2025-05-14T13:07:00.000Z","updated_at":"2025-05-21T13:07:52.000Z","dependencies_parsed_at":"2025-06-01T09:32:34.177Z","dependency_job_id":"82ab2727-a96e-4328-87c3-1db69f73c641","html_url":"https://github.com/yiisoft/psr-emitter","commit_stats":null,"previous_names":["yiisoft/psr-emitter"],"tags_count":1,"template":false,"template_full_name":"yiisoft/package-template","purl":"pkg:github/yiisoft/psr-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fpsr-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fpsr-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fpsr-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fpsr-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiisoft","download_url":"https://codeload.github.com/yiisoft/psr-emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiisoft%2Fpsr-emitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260671460,"owners_count":23044621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emitter","http","psr","psr-7","yii3"],"created_at":"2025-06-04T16:00:46.296Z","updated_at":"2025-06-26T09:30:58.747Z","avatar_url":"https://github.com/yiisoft.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yiisoft\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://yiisoft.github.io/docs/images/yii_logo.svg\" height=\"100px\" alt=\"Yii\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eYii PSR Emitter\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/yiisoft/psr-emitter/v)](https://packagist.org/packages/yiisoft/psr-emitter)\n[![Total Downloads](https://poser.pugx.org/yiisoft/psr-emitter/downloads)](https://packagist.org/packages/yiisoft/psr-emitter)\n[![Build status](https://github.com/yiisoft/psr-emitter/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/yiisoft/psr-emitter/actions/workflows/build.yml?query=branch%3Amaster)\n[![Code Coverage](https://codecov.io/gh/yiisoft/psr-emitter/branch/master/graph/badge.svg)](https://codecov.io/gh/yiisoft/psr-emitter)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fpsr-emitter%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/psr-emitter/master)\n[![Static analysis](https://github.com/yiisoft/psr-emitter/actions/workflows/static.yml/badge.svg?branch=master)](https://github.com/yiisoft/psr-emitter/actions/workflows/static.yml?query=branch%3Amaster)\n[![type-coverage](https://shepherd.dev/github/yiisoft/psr-emitter/coverage.svg)](https://shepherd.dev/github/yiisoft/psr-emitter)\n[![psalm-level](https://shepherd.dev/github/yiisoft/psr-emitter/level.svg)](https://shepherd.dev/github/yiisoft/psr-emitter)\n\nThe package provides `EmitterInterface` that is responsible for sending PSR-7 HTTP responses as well as several implementations of the interface:\n\n- `SapiEmitter` - sends a response using standard PHP Server API;\n- `FakeEmiiter` - a fake emitter that does nothing, except for capturing response (useful for testing purposes).\n\nAdditionally, the package provides `EmitterMiddleware` PSR-15 middleware that can be used in an application to send \na response by any `EmitterInterface` implementation.\n\n## Requirements\n\n- PHP 8.1 or higher.\n\n## Installation\n\nThe package could be installed with [Composer](https://getcomposer.org):\n\n```shell\ncomposer require yiisoft/psr-emitter\n```\n\n## General usage\n\nCreate emitter instance and call `emit()` method with a PSR-7 response:\n\n```php\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Yiisoft\\PsrEmitter\\SapiEmitter;\n\n/** @var Response $response */\n\n$emitter = new SapiEmitter();\n$emitter-\u003eemit($response);\n```\n\nYou can customize the buffer size (by default, 8MB) for large response bodies:\n\n```php\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Yiisoft\\PsrEmitter\\SapiEmitter;\n\n/** @var Response $response */\n\n$emitter = new SapiEmitter(4_194_304); // Buffer size is 4MB\n\n// Response content will be sent in chunks of 4MB\n$emitter-\u003eemit($response);\n```\n\n## Documentation\n\n- [Internals](docs/internals.md)\n\nIf you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place\nfor that. You may also check out other [Yii Community Resources](https://www.yiiframework.com/community).\n\n## License\n\nThe Yii PSR Emitter is free software. It is released under the terms of the BSD License.\nPlease see [`LICENSE`](./LICENSE.md) for more information.\n\nMaintained by [Yii Software](https://www.yiiframework.com/).\n\n## Support the project\n\n[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective\u0026logoColor=7eadf1\u0026labelColor=555555)](https://opencollective.com/yiisoft)\n\n## Follow updates\n\n[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)\n[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter\u0026logoColor=1DA1F2\u0026labelColor=555555?style=flat)](https://twitter.com/yiiframework)\n[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat\u0026logo=telegram)](https://t.me/yii3en)\n[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat\u0026logo=facebook\u0026logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)\n[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat\u0026logo=slack)](https://yiiframework.com/go/slack)\n","funding_links":["https://opencollective.com/yiisoft","https://github.com/sponsors/yiisoft"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fpsr-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiisoft%2Fpsr-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiisoft%2Fpsr-emitter/lists"}