-
-
Notifications
You must be signed in to change notification settings - Fork 247
[3.0] Add HTTP Factories for Guzzle #125
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
Conversation
Do you know there exists https://github.com/http-interop ? It has different factories implementation also. |
|
Yes, that isn't stable or widely adopted yet. |
|
@barryvdh you can point to a release https://github.com/http-interop/http-factory/releases . Not widely adopted is for it is WIP . But you should consider discussing with @shadowhand , @nyamsprod for they also part of League and they have some of the implementations based on it. ( https://github.com/bakame-php/http-client ) . |
There also is https://github.com/php-http/message-factory from @sagikazarmark and other, which at least is stable, but also not widely adopted yet. I could see myself adding a php-http Client, besides the default Guzzle one. But not sure how relevant a Http Factory abstraction is. What would be the main benefit, avoiding duplicate PSR-7 libraries? Perhaps also avoid package lock-in, although we don't expose the internals, so should be able to upgrade without breaking BC.. |
|
sure 👍 . Thanks for the information. |
|
I did some more reading, and I do kind of like both projects, but the problem is that:
Due to the problems of requiring external interfaces now (Guzzle 3 Http client), I would really like to be sure the interface is here to stay for a good amount of time and otherwise use our own interface/class. And we really can't keep waiting for another half year. |
|
@barryvdh exactly, the http-interop for the factory is nearly complete (don't be distracted by the 0.1.0 tag) so If I were to consider one of them I would go with the http-interop interfaces but @SHADOWAND may better answer this question. What is sure is that whatever changes may happen in the factories adding a "simple" wrapper around the current interface will solve the issue. |
|
I agree with @nyamsprod given PSR-17 is finished within a certain time.
That is not correct, we started the project way earlier than PSR-17 was proposed. As such, many of our projects rely on it, so we are not going to drop the support for it. Also, I am planning to provide bridges in both direction, so new software can use the old interfaces, and an old software can use the new implementations. |
Okay apologies, I meant that it seems that php-http/message-factories is already planned on being deprecated based on php-http/message-factory#32 (comment)
So while it might still receive support, it would be better to follow the 'official' one :) |
No problem, just wanted to provide you correct information. |
I think this cleans up the factories pretty well, as we don't need to inject a lot of dependancies everywhere. Note that we do require on Guzzle/psr7 for this, but only internally, so we can upgrade to other PSR-7 factories when required.