tomrf/http-emitter

PSR-7 响应发射器

0.0.2 2022-06-15 21:04 UTC

This package is auto-updated.

Last update: 2024-09-20 03:45:29 UTC


README

PHP Version Require Latest Stable Version License

简单 PSR-7 响应发射器,具有合理的 CLI SAPI 输出

📔 前往文档

安装

通过 composer 安装

composer require tomrf/http-emitter

使用方法

$httpEmitter = new HttpEmitter();
$httpEmitter->emit($response); // PSR-7 response object

测试

composer test

许可证

本项目采用 MIT 许可证(MIT)发布。有关更多信息,请参阅LICENSE

文档

📂 Tomrf\HttpEmitter\HttpEmitter::class

PSR-7 消息响应发射器。

emit()

根据当前 PHP SAPI 使用 SapiEmitter 或 SapiCliEmitter 发射响应。

public function emit(
    Psr\Http\Message\ResponseInterface $response
): void

📂 Tomrf\HttpEmitter\Sapi\SapiCliEmitter::class

PSR-7 消息响应发射器,用于 SAPI 命令行。

emit()

将响应输出到终端。

public function emit(
    Psr\Http\Message\ResponseInterface $response
): void

📂 Tomrf\HttpEmitter\Sapi\SapiEmitter::class

通用 PSR-7 消息响应发射器,用于 SAPI。

emit()

将响应输出到标准输出。

public function emit(
    Psr\Http\Message\ResponseInterface $response
): void

生成时间:2022-06-15T23:05:29+02:00,使用 📚tomrf/readme-gen