configcat / php-sdk

ConfigCat SDK for PHP. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
https://configcat.com/docs/sdk-reference/php
MIT License
20 stars 11 forks source link

Make Guzzle dependency optional #38

Closed ruudk closed 1 year ago

ruudk commented 1 year ago

It would be great if the Guzzle dependency could be made optional.

Instead, the project should allow any PSR7 client.

One way to deal with this is using https://github.com/php-http/discovery.

This allows people to use their own compatible client.

z4kn4fein commented 1 year ago

Hi @ruudk, thank you for the suggestion! I agree it should be replaceable. I'll make it configurable with a configuration option.

However, I'm not sure if we can remove the direct dependency on Guzzle as we'd keep it for a default HTTP client when the user is not configuring anything custom.

ruudk commented 1 year ago

Same as with #41, people that use a dependency for something as Configcat, know how to also pull in a Guzzle dependency.

This SDK is not for hello world projects. I believe it's only used when a project get more serious and has a need for feature flags 😉

z4kn4fein commented 1 year ago

Hey @ruudk, in v8.1.0, the underlying HTTP client became replaceable. In the next major upgrade we'll move guzzlehttp/guzzle into suggest.

ruudk commented 1 year ago

âš¡ Great work!