Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR-18 Support (formerly: PSR-7 Support) #25

Open
mikemilano opened this issue Jun 4, 2018 · 4 comments
Open

PSR-18 Support (formerly: PSR-7 Support) #25

mikemilano opened this issue Jun 4, 2018 · 4 comments

Comments

@mikemilano
Copy link

I have a project that uses Guzzle6, which conflicts with the 5.3 dependency in this project. As a result, I cannot install via composer.

With PSR-7 support, I would be able to make this work. It's nice for testing as well. http://docs.php-http.org/en/latest/index.html

Here's a project I'm working that has PSR-7 clients implemented: http https://github.com/mikemilano/xrphp

@mikemilano
Copy link
Author

For anyone else having this problem in the short term, the master branch supports guzzle 6.3. PSR-7 implementation would still be valuable, however the work-around right now is to use the dev-master version in composer.

"platformsh/client": "dev-master"

@pjcdawkins
Copy link
Collaborator

Hi, yes the master branch (and the 2.x.x "beta" releases) works with Guzzle 6, and by extension uses PSR-7. So either of these would be compatible with Guzzle 6, and effectively the same thing right now:

"platformsh/client": "dev-master"
"platformsh/client": "^2.0.0@beta"

It's only "beta" because there hasn't been demand/reason to go further. We could change that...

@mikemilano
Copy link
Author

mikemilano commented Jun 4, 2018

Thanks for the info.

To clarify, I wasn't just recommending using a PSR-7 Guzzle implementation (what's the point?), but rather a PSR-7 approach as documented in the PHP-HTTP/HTTPLUG docs I linked where generic PSR-7 clients and messages are used so the library can discover and use whatever adapter the project uses.... instead of locking the developer's app into using whatever version of Guzzle you are using here.

Right now, since guzzle 6.3 is required in composer.json, anyone who's project had a guzzle 5.x requirement would not be able to use this library.

You will notice in the XRPHP project I linked, there's no specific guzzle version required, except in the tests. This means someone can use any adapter they want with the library, which includes guzzle 5, guzzle 6, curl, socket, cakephp, zend, etc.

That said, I'm not stuck and it's just a recommendation. I think implementing it will avoid the situation in the future where users need to use the non-stable release, or they are unable to use it at all.

@Kingdutch
Copy link
Contributor

Perhaps we can retitle this to move to PSR-18 (psr/http-client-implementation) instead? As that's supported by things like php-http/guzzle6-adapter and by Guzzle 7 natively? That PSR is the follow-up to what HTTPlug was doing.

@pjcdawkins pjcdawkins changed the title PSR-7 Support PSR-18 Support (formerly: PSR-7 Support) Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants