middlewares/emitter

Middleware to send a PSR-7 response using header() and echo

v1.0.3 2020-12-02 00:05 UTC

This package is auto-updated.

Last update: 2022-04-29 01:16:21 UTC


README

Latest Version on Packagist Software License Testing Total Downloads

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

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.