承接 tflori/tal 相关项目开发

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

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

tflori/tal

最新稳定版本:v2.0.0

Composer 安装命令:

composer require tflori/tal

包简介

A guzzle/psr-7 wrapper to add additional functionality like sending responses and managing cookies

README 文档

README

Build Status Coverage Status Latest Stable Version Total Downloads License

This is a clone of guzzle/psr-7 with additional functionality like sending responses and managing cookies. Because they changed the access level of the properties to be private I was forced to copy the code instead of extending it.

If you think the code from guzzle has changed a lot and this is outdated - feel free open a pull request.

PSR-7 Extended

This fork is using an extended and fully compatible version of PSR-7. This extension breaks some statements made on the meta document of PSR-7.

In PSR-7 every message should be immutable. That means that you can not change a message after it got created. Instead you have to clone it and modify the clone. I do not fully agree that every message has to be immutable. While it is true that a request send from a client on the servers side should not be changed because the request already happened. The request can sill be changed before it gets sent to the server. The same is valid for the response: the client should not change the response but the server can change the response before it gets sent to the client.

Therefore we split the request and response interfaces two:

  • Tal\Psr7Extended\ClientRequestInterface - the request that will be sent from client to server
  • Tal\Psr7Extended\ClientResponseInterface - the response that got sent from server to client
  • Tal\Psr7Extended\ServerRequestInterface - the request that got sent from client to server
  • Tal\Psr7Extended\ServerResponseInterface - the response that will be sent from server to client

They are fully compatible with the PSR-7 interfaces. That means that the with*() methods still exist and can also be used to change the client request and server response. But you have to understand that this is not just a philosophical question: when you clone the message and modify the properties it means that the object has to be copied in the memory. Even if you don't store the old object it has to be collected and removed from the garbage collector.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固