Search by

sabroan / http-emitter

Sabroan

A PSR-7 HTTP response emitter

Package info

github.com/sabroan/php-http-emitter

pkg:composer/sabroan/http-emitter

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-10-14 10:03 UTC

This package is auto-updated.

Last update: 2026-10-14 10:07:09 UTC


README

A lightweight PHP HTTP response emitter.

Installation

composer require sabroan/http-emitter

Usage

Pass a PSR-7 ResponseInterface instance to SapiEmitter::emit():

<?php

declare(strict_types=1);

use Psr\Http\Message\ResponseInterface;
use Sabroan\Http\Emitter\SapiEmitter;

/** @var ResponseInterface $response */

$emitter = new SapiEmitter();

$emitter->emit($response);

The emitter sends the response status and headers using PHP's native SAPI functions, then writes the response body to the output. The emit() method returns true when emission completes successfully.

License

This package is released under the MIT License. See the LICENSE file for details.