-
Notifications
You must be signed in to change notification settings - Fork 38
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
HttpAdapterFactory #25
Comments
Currently our idea is that adapters provide |
Since the Http Adapter has been separated into actual Adapter and Client, this functionality should go into the client IMO. |
Why no I don’t think this is top-priority though. |
I would not add that into the contract. It is not as stable as the exceptions for example. Either in the adapter client or in a separate package. It is rather a hack than a real solution. In an ideal case, all dependencies should always be injected instead of auto setup. |
How would you handle a case like FriendsOfSymfony/FOSHttpCache#173 (diff)? |
Yeah, I agree the guesser could be useful in that case. Do you think putting it in a separate package is a bad idea? (Because putting one class in a separate package seems to be a bit odd) The case I would like to avoid is to version the guesser together with the adapter, because as new adapters are created, they must be added to the guesser (which makes the adapter pretty unstable). One thing I can think of is adding an empty guesser to the adapter contract and somehow the installed adapters could register themselves during autoloading. But this also sounds weird. |
Maybe message-factory-guesser and adapter-guesser could moved into one package. |
@ddeboer https://github.com/php-http/guesser Does this solve your issue? |
It definitely does! |
Updated toolbar logo
The egeloen library had an HttpAdapterFactory that tries to automatically instantiate an HTTP adapter based on the HTTP client library that is installed. Should we create an php-http/adapter-factory (or adapter-guesser?) package, too?
The text was updated successfully, but these errors were encountered: