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

Remove dependency on Guzzle #41

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

shulard
Copy link
Contributor

@shulard shulard commented Apr 4, 2016

We discussed in #34 about the fact that this library is fully coupled to Guzzle. I've worked on that PR to use the php-http/httplug interfaces which allow to decouple from any HTTP client.

In the dev dependencies I still require the Guzzle6 adapter to make all the tests passing.

With that update, it's possible to use the OVH API with all the Httplug adapters (ReactPHP, Socket, Curl, Guzzle5, Guzzle6, Buzz...).

All the projects which requires the OVH API must also require an adapter. It also allow to use the same HTTP client than in the project (just require the adapter).

I've also implemented the HttplugDiscovery plugin which allow to automatically resolve the currently available package through Puli. The only requirement is that the user include the puli composer plugin.

If you have any questions about the implementation, just ask 😄.

The library usage is the same as before, we can pass an HttpClient instance to the Api client or let the Discovery package resolve the current client.

@yadutaf
Copy link
Contributor

yadutaf commented Apr 4, 2016

Hi,

Thanks for your contribution. It looks like a great change!

I'm not à PHP developer, but what will happen to code passing a Guzzle instance to the constructor which now expects an adapter ? Is it possible to handle this case to avoid breaking the API ?

@shulard
Copy link
Contributor Author

shulard commented Apr 5, 2016

Hello!
Thanks for the review 😄.

Insuring non BC break here is a nice idea but it force to include Guzzle as a required dependency. With that we are not taking all the benefits from the decoupling...

I saw that OVH Api change its major version number from Guzzle5 to Guzzle6. Maybe we can use the same here because the HTTP adapter is the hearth of the lib.

If you really want to avoid BC and staying on a 2.x, we can make a decorator to handle the previous Guzzle behaviour and make that decorator the default implementation...

@Nyholm
Copy link

Nyholm commented Jul 23, 2016

Can I assist somehow to make sure this PR get merged? @yadutaf are you 👍 for a change like this?

@shulard
Copy link
Contributor Author

shulard commented Sep 27, 2016

Any news on that PR ?

@yadutaf
Copy link
Contributor

yadutaf commented Sep 27, 2016

ping @VincentCasse

`php-http/guzzle-adapter` is still required as dev dependency because it is used as the base adapter. All the unit tests required that client to work.
All the data are computed before `Request` creation. It allow to perform a simple `new Request` with all the analysis result.

Headers are set with authentication, URI is cleaned...
All the calls go through that method, it'll allow extensibility.
Guzzle is still used inside the test logic with middlewares.
Allow to perform a dynamic client resolution based on the current context.
Require the puli composer extension to be registered : https://php-http.readthedocs.org/en/latest/discovery.html#installation
@shulard
Copy link
Contributor Author

shulard commented Dec 13, 2016

Hello guys,

I've rebased on master and fixed the conflicts. Are you open to accept a change like this ?

@jas8522
Copy link

jas8522 commented Jan 12, 2018

I would also be very interesting in having this merged. I'm trying to integrate this OVH library within a project already using Guzzle5: it's quite problematic. These changes would make it possible to avoid these conflicts.

@Romaxx
Copy link

Romaxx commented May 9, 2018

Interested too, with Symfony 4, PSR7, HttPlug is recommended.

@peter279k
Copy link
Contributor

Some files have the conflict because the PR is older than master branch.

These files should be fixed.

@shulard
Copy link
Contributor Author

shulard commented May 13, 2019

Of course, this PR is 2 years old 😄. I can update the content, but are the maintainers ok with that kind of update ? If yes I'll work on the rebase asap.

@ChristophWurst
Copy link

are the maintainers ok with that kind of update ? If yes I'll work on the rebase asap.

👋 hello :)

we at Nextcloud have a community PR pending that wants to integrate with OVH: nextcloud/twofactor_gateway#316. Thus I would kindly like to know if there is any progress on this matter and/or if anything is missing that could be helped with. What is the status here? :)

Cheers

@jdecool
Copy link

jdecool commented Feb 14, 2020

Some news about this PR ?

Is there any chance that is merged ?

@rbeuque74 rbeuque74 self-assigned this Feb 27, 2020
@DurandSacha
Copy link

I think merging would solve a lot of compatibility issues.

@shulard
Copy link
Contributor Author

shulard commented Jul 25, 2022

Hello !

This is a 6 years old PR, I think that this change will never be merged inside this library.

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

Successfully merging this pull request may close these issues.

None yet

10 participants