Add support for psr/http-message v2
I recommend adding support for psr/http-message v2, which was released in April and requires PHP 7.2+. To ensure compatibility with psr/http-message v2 across all currently supported versions in http (PHP 5.3+), we will need to implement some additional workarounds for older PHP versions. These workarounds are necessary not only for the current v1 of http, but also for the upcoming v3, which will support PHP 7.1+. We will also need to include additional tests to ensure our compatibility with psr/http-message v2.
Additionally we need to remove the dependency for ringcentral/psr7 as discussed in #485, which currently has a dependency on psr/http-message v1. This project has not received updates since 2020, and it is unlikely to receive support for psr/http-message v2 anytime soon. To ensure compatibility with psr/http-message v2, we must first remove ringcentral/psr7.
I'll update this ticket as we make progress :+1:
If you need this feature urgently, you can always reach out to us or help us prioritizing by becoming a sponsor and supporting the ReactPHP ecosystem ❤️
Any progress here? Just installed your package, but my application needs pst/http-message v2, so had to do some changes to check if i can use v1, but i can't sadly, all my other packages and libs are already v2..
+1
+1
I'd really like to bundle this package with the LLPhant (theodo-group/llphant) library for a project I'm working on. Unfortunately, LLPhant mandates psr/http-message v2, as does the Opensearch PHP library (opensearch-project/opensearch-php), so I'm pretty much dead in the water. Is support for psr/http-message v2.0 a long way off?
+1
Hello, is this repo always maintained? Waiting this for months but maybe we should find another lib?
Thank you
Hello, is this repo always maintained?你好,这个仓库是否一直有人维护? Waiting this for months but maybe we should find another lib?等待这个几个月了,但也许我们应该找另一个库?
Thank you 感谢
+1
Hello, is this repo always maintained?
Yes, but please see Personal challenges in this post https://github.com/ratchetphp/Ratchet/issues/1054#issuecomment-2718643954
@WyriHaximus any idea if Mr. Boden is also going through some personal challenges? He put in most of the code in the early days but hasn't put in any code at all for a long time.
@zhiyong-ft That is for @cboden to tell. But in general, projects see people leave and take a step back when life hits them in ways they need more time. Everyone also handles things differently, some move on, some take a break, some take it easier. Personally I did all 3 when shit hit the fan for me now almost two years ago. I'm hoping that with @clue now getting back on track we get v3 out the door and that IIRC should include this
psr/http-message v2 requires a minimum of either php ^7.2 or ^8.0. This repository currently requires a minimum of at least ^7.1, so updating the minimum version of psr/http-message would require raising the minimum PHP language. If it is fine to do so then the dependency should be able to be updated without any further consideration needed.
Could we at least support v2 for react/http 3.x then?
I actually don't see a reason why it couldn't just be added to composer.json immediately. Composer will only install the version that's most compatible with whatever version of PHP you have installed. I'll make a PR and cross my fingers it'll be accepted.
Could we at least support v2 for react/http 3.x then?
That is the plan, due to return type hints it's v1 for v1 and v2 for v3.
@WyriHaximus maybe you are aware of it, but on https://github.com/php-fig/http-message/releases/tag/2.0 the following page is mentioned: https://www.php-fig.org/psr/psr-7/meta/#72-type-additions, which suggests that requiring PHP 7.2 and "psr/http-message": "^1.1 || ^2.0" might be a way to support both and let Composer decide what to install?
@holtkamp So here is where it gets funny, before @clue and I had to deal with shit in our personal lives the plan was to release v3 targeting PHP 7.1, and then decide what v4 would be. But very likely v4 will be PHP 8.1 and up, which means that v3 won't get psr/http-message v2. Now enough time has passed that we IMHO should skip v3 and go straight to v4, skip straight to psr/http-message v2, and update all others. But haven't talked to @clue in a while, so we haven't aligned and agreed on this. In order to make this happen, we need https://github.com/clue/reactphp-http-proxy/pull/65 by @kwhat (or something along the lines of it) merged and released, and then https://github.com/reactphp/http/pull/542 by @valzargaming (or something the likes of it) in, do all the other v3 and v4 work and release a new major version. Which does all mean it's not a quick and easy in place update for certain packages relying on it.
Hm, the problem is of course that the longer you wait the more packages will start having incompatibilities. I'm all for backwards compatibility but do you really need php 7.1? End of life was 8 years ago and end of security support 5 years. A minor release with an update to require 7.4 (which is 2 years past security support) seems appropriate.
Exactly, that's my point of going with v4 and skipping v3. Also, we're not just consumers of psr/http-message, we also provide implementations, so updating those classes is a BC break depending on how you look at it. And I really want to get v4 out because v1 currently supports all the way down to PHP 5.3....