-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
Thanks. I will take a look at it in the evening. Don't care about the failing tests: they are because diactoros require PHP 5.5 and we still test again 5.4. If we can decouple from a specific message implementation then this issue will go away. |
|
||
namespace Http\Adapter; | ||
|
||
use FOS\HttpCache\Exception\ProxyUnreachableException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that really a Friends of Symfony class in Guzzle 6?
Please check the guzzle5-adapter package to see how integration test should be added. |
} | ||
], | ||
"require": { | ||
"php": ">=5.4", | ||
"php-http/adapter-core": "dev-internal_separation" | ||
"php-http/adapter-core": "dev-internal_separation", | ||
"guzzlehttp/guzzle": "6.x-dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to ~6.0
when Guzzle 6 has been released.
Sorry, accidentally committed some WIP stuff. Fixed that.
I only see an |
See this file. The two methods you have to implement: AFAIK Guzzle 6 uses the same ring architecture, so you should probably create multiple tests to test with various handlers. |
Thanks. I meant: that’s the |
Ah, I missed that, I thought you extended the |
Yes, things becomes different in the case of Guzzle 6, which does PSR-7 natively. My intuition is that we don’t really need CoreHttpAdapter in this case. I like the minimalist PsrHttpAdapter interface, which just takes PSR-7 request objects. Now PSR-7 has been accepted, more and more users will probably start working with those objects in their projects. This makes the HttpAdapter (with In any case, I do think we need a new ConfigurablePsrHttpAdapter to use |
I am not entirely sure that HttpAdapter should always be implemented. However extending CoreHttpAdapter is extremely easy: replace sendRequest and sendRequests methods with their sendInternal* methods. I am waiting for some feedback from @egeloen with the upcoming interface separation. After that we can discuss how we should proceed with PSR7 clients (since it is the first one). |
But do we still need the distinction between internal and PSR-7 requests when building adapters for PSR-7 libraries? Okay, I’ll wait with adding tests until the interface segregation has been finished. Where is the discussion taking place? |
There isn't really a discussion, because @egeloen is disappeared. I invited you to the Gitter room. Internal requests are not just there to provide a bridge between PSR7 and non-PSR7 clients. They are also used for special type bodies, like files, or arrays. |
Guzzle 6 is released |
Thanks, I had already changed the version constraint. |
I've been thinking about this whole thing with PSR and not PSR. I think the right choice would be to have a Client implementation which relies on adapters. This way adapters can remain PSR wrappers and the client implements the callable methods AND most of the internal request things. |
I’m not sure I understand. Do you mean you want to keep the internal/PSR request separation and the HttpAdapter’s convenience methods? |
I mean I want to move them to a separate implementation (Client) and use adapters there. All the internal request and convenience methods would be part of the HTTP Client implementation. Adapters would only be PSR wrapper this way (basically accepting requests and returning responses). |
I like it, as it keeps the adapters lean and pure PSR-7. I guess adapters for non PSR-7-compliant HTTP clients such as Guzzle 5 would then convert between the PSR request object as produced by Http\Client and the Guzzle 5 request object (and vice versa for the response). |
Exactly. |
@ddeboer Thanks for your contribution. I am going to merge this and finish tests. |
Implement Guzzle 6 adapter
No description provided.