承接 thruster/http-modifier 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thruster/http-modifier

Composer 安装命令:

composer require thruster/http-modifier

包简介

Thruster HttpModifier Component (Modifies PSR-7 Request & Responses)

README 文档

README

[Latest Version] (https://github.com/ThrusterIO/http-modifier/releases) [Software License] (LICENSE) [Build Status] (https://travis-ci.org/ThrusterIO/http-modifier) [Code Coverage] (https://scrutinizer-ci.com/g/ThrusterIO/http-modifier) [Quality Score] (https://scrutinizer-ci.com/g/ThrusterIO/http-modifier) [Total Downloads] (https://packagist.org/packages/thruster/http-modifier)

[Email] (mailto:team@thruster.io)

The Thruster HttpModifier Component. Provides a backbone for modifying PSR-7 Request/Response for HTTP Clients/Servers and other utilities which uses PSR-7 standard.

Collection of Thruster Http Modifiers

Install

Via Composer

$ composer require thruster/http-modifier

For PHP < 7.0

For older PHP version than PHP7 there is branch php5

$ composer require thruster/http-modifier ">=1.0,<2.0"

Usage

There are four type of modifiers:

  • ServerRequestModifierInterface
  • RequestModifierInterface
  • ResponseModifierInterface
  • MessageModifierInterface

Each of them has own Collection to group them and run modify on each of modifier.

Standalone modifier

$modifier = new class implements ResponseModifierInterface {
	public function modify(ResponseInterface $response) : ResponseInterface
	{
		return $response->withHeader('X-Powered-By', 'Thruster/1.0');
	}
}

$response = $modifier->modify($response);

Using collection

$collection = new ResponseModifierCollection();
$collection->add(new ServerTimeModifier());
$collection->add(new PoweredByModifier('Thruster/1.0'));

$response = $collection->modify($response);

Nesting collections

$collectionA = new ResponseModifierCollection();
$collectionA->add(new ServerTimeModifier());
$collectionA->add(new PoweredByModifier('Thruster/1.0'));

$collectionB = new ResponseModifierCollection();
$collectionB->add($collectionA);

$response = $collectionB->modify($response);

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

License

Please see License File for more information.

统计信息

  • 总下载量: 372
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固