middlewares / emitter
Middleware to send a PSR-7 response using header() and echo
Installs: 19 455
Dependents: 4
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- laminas/laminas-diactoros: ^2.2
- middlewares/utils: ^3.0
- oscarotero/php-cs-fixer-config: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8|^9
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-11-29 05:51:13 UTC
README
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
- PHP >= 7.2
- A PSR-7 http library
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/emitter.
composer require middlewares/emitter
Usage
Dispatcher::run([ new Middlewares\Emitter(), // Here the rest of your middlewares ]);
maxBufferLength
Maximum output buffering size for each iteration. By default is 8192
bytes.
$emitter = (new Middlewares\Emitter())->maxBufferLength(512);
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.