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 Guzzle 3.x dependency (without BC) #223

Closed
wants to merge 1 commit into from
Closed

Remove Guzzle 3.x dependency (without BC) #223

wants to merge 1 commit into from

Conversation

jeromegamez
Copy link
Contributor

Replaced by #224 for the 1.0 branch

Greetings!

The changes in this PR enable developers to override the Guzzle 3.x dependency with any library supported by the Ivory HTTP adapter (which, as a bonus point, implements PSR-7).

I lied in the PR title :) - in order not to introduce breaking changes for existing users, the default HTTP adapter is still using the Guzzle ~3.7 dependency. This is to address the possible use cases where projects rely on thephpleague/oauth2-client to require "guzzle/guzzle": "~3.7" and use it for their own needs.

However, if a project is using another HTTP client, it can be configured like this:

use Ivory\HttpAdapter\CurlHttpAdapter;
use Ivory\HttpAdapter\GuzzleHttpHttpAdapter;

$httpClient = new CurlHttpAdapter(); // Native curl
// or
$httpClient = new GuzzleHttpHttpAdapter(); // Guzzle 5
// or …

$provider = new League\OAuth2\Client\Provider\<ProviderName>([
    'clientId'      => 'XXXXXXXX',
    'clientSecret'  => 'XXXXXXXX',
    'redirectUri'   => 'https://your-registered-redirect-uri/',
    'scopes'        => ['email', '...', '...'],
], $httpClient);

You can find a list of supported adapters and a full usage documentation in the Ivory HTTP Adapter README.

I hope this PR receives your approval, and your feedback would be highly appreciated.

Cheers
:octocat: Jérôme

PS: If breaking changes are okay (as the oauth2-client library is at a 0.x release), we could also replace the default HTTP adapter to the Curl Adapter and completely remove the Guzzle 3.x dependency.

@jeromegamez jeromegamez changed the title Remove hard Guzzle 3.x dependency (without BC) Remove Guzzle 3.x dependency (without BC) Feb 20, 2015
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) to 99.81% when pulling 8d0a8cb on jeromegamez:feature/http-adapter into e18c99c on thephpleague:master.

@ramsey
Copy link
Contributor

ramsey commented Feb 20, 2015

Version 1.0 of oauth2-client has been upgraded to use Guzzle 5. I would prefer to make these kinds of changes in the 1.0 branch rather than in the 0.x series.

Do you mind taking a look at the 1.0 branch and seeing if this work is more appropriately applied there?

@jeromegamez
Copy link
Contributor Author

Thank you for your quick feedback @ramsey, I just created a new PR, targeted at the 1.0 branch, at #224.

@Nyholm Nyholm mentioned this pull request Jul 21, 2016
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

3 participants