quimcalpe/psr7-response-sender

PSR-7 响应发送器

0.1.3 2016-05-20 14:26 UTC

This package is auto-updated.

Last update: 2024-09-05 01:34:59 UTC


README

Version License Build Status

将PSR-7响应兼容对象的内容和头信息发送到浏览器。

安装

通过Composer

$ composer require quimcalpe/psr7-response-sender

要求

以下版本的PHP受此版本支持。

  • PHP 5.5
  • PHP 5.6
  • PHP 7
  • HHVM

基本用法

// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';

// $response must be Psr\Http\Message\ResponseInterface compatible
QuimCalpe\ResponseSender\send($response);

使用PHP 5.6,您可以直接导入函数

use function QuimCalpe\ResponseSender\send AS send_response;

send_response($response);

测试

$ vendor/bin/phpunit

许可

MIT许可(MIT)。请参阅许可文件以获取更多信息。