Repository navigation
Decouple from Guzzle - #389
Conversation
| { | ||
| if (null === $this->httpClient) { | ||
| $this->httpClient = new HttpClient($this->options); | ||
| if ($this->pluginsModified) { |
There was a problem hiding this comment.
you need to reset this property here, otherwise a new client will be created for each call to the getter
|
@Nyholm looks good! What do you guys say @docteurklein @gquemener ? P.S. that's a good candidate for 2.0 |
|
Thank you. I'll make the changes you suggested. Give me a couple of days. |
|
I totally agree with the idea of using an http client abstraction! |
|
The tests are passing. I might need help making sure the docs are up to date. I will try to proof read the existing docs tomorrow. More reviews are much welcome. Also, please try it out in your project to make sure I haven't missed anything. |
|
@Nyholm will be able to check it tomorrow! |
| } | ||
| $response = $this->client->getHttpClient()->get($path, $parameters, $requestHeaders); | ||
|
|
||
| if (count($parameters)>0) { |
There was a problem hiding this comment.
count($parameters) > 0 or 0 !== count($parameters)
|
fantastic work you have done here @Nyholm |
|
Thank you @cursedcoder. I've updated the code according to your comments. They all makes perfect sense and some were just typos of mine. Please do. |
| > `php-github-api` follows the PSR-0 convention names for its classes, which means you can easily integrate `php-github-api` classes loading in your own autoloader. | ||
| > `php-github-api` follows the PSR-4 convention names for its classes, which means you can easily integrate `php-github-api` classes loading in your own autoloader. | ||
|
|
||
| Why `php-http/guzzle6-adapter`? We are decoupled form any HTTP messaging client with help by [HTTPlug](http://httplug.io/). Read about clients in our [docs](doc/cusomize.md). |
|
I've fixed the typo and rebased the PR. |
This PR replaces #352. We do not want to be coupled to Guzzle, instead we want to use an abstraction layer so the end user can choose what HTTP message implementation to use.
This PR removes all our HTTP layer and replaces it with Httplug and custom plugins. I struggled for a while to make this PR backwards compatible but the code got too complicated and would have left us with an abstraction for an abstraction.
Question to the maintainers:
Do you like this change? Should I continue with this PR and complete the TODOs?
TODO