8p / EightPointsGuzzleBundle

⛽️ Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony
MIT License
440 stars 71 forks source link

Several clients #13

Closed sebastianblum closed 9 years ago

sebastianblum commented 9 years ago

Hello!

I like your bundle and want ask, if you can add support for several clients.

like this:

guzzle:
    apiClient:
        plugin:
           wsse:
               username: acme
               password: pa55w0rd
    legacyClient:
        base_url: /old/api/without/wsse

Or has anyone a better idea for several clients in one application?

Thank you very much

florianpreusner commented 9 years ago

Hi,

thanks for this idea. I will think about how this feature can be implemented next days. Seems to be a useful functionality.

Best regards Florian

florianpreusner commented 9 years ago

Hi,

I'm sorry, but I'm not having time to add this feature right now. Maybe I will find some time next week or the week after. Sorry. If someone has a idea I would be grateful.

Best regards Florian

florianpreusner commented 9 years ago

Added functionality. Please check if everything is implemented like expected. Thanks.

sebastianblum commented 9 years ago

Hello!

Thank you very much for the feature, you implemented a great solution.

But now we have a BC break. My intension was the following:

guzzle:
    base_path: ...
    plugins: ...

    clients:
        crm_client:
            base_path: overwritten base path
            plugins: overwritten plugins

So you can use only one client or you can defined additional clients.

What you do think about that and the BC break @florianpreusner ?

florianpreusner commented 9 years ago

Hi,

yes, this is a BC break but I guess it is not a good idea to have such a dynamic configuration to allow a single client and multiple clients. With the implemented version you are able to setup one or more clients. When using a alias you are still able to get the single client by your preferred name like mentioned in README.md.

Best regards Florian

sebastianblum commented 9 years ago

yes, if BC break is no problem for you, I'm fine. Thank you very much for your help and support

florianpreusner commented 9 years ago

You're welcome.

Going to release a new major version (v.4.0.0) soon so there will be no break in other versions.