- πΊπ¦Ukraine pingwin4eg Zaporizhia πΊπ¦
$this->config['stream'] = true
This is incorrect approach since this way guzzle uses stream wrapper, leading to an indefinite recursion: remote stream wrapper -> guzzle -> remote stream wrapper...
I did some investigation regarding context options, and I think it's possible to provide the method, headers and probably some other options from the stream context (
stream_context_get_options($this->context)
) to guzzle's request() $options, but I'm not sure about all of them (not even sure it's possible, but I'm not an expert in this field).There's a separate issue for remote_stream_wrapper:7.x-1.x-dev - #2522056: Use the native PHP stream wrapper if available. β . It tries to achieve the same (or at least similar) goal using a different approach - "by wrapping the wrapper" if I understand it correctly. Maybe that is a better way, but as I see from comments - still not everything is possible.
This issue summary needs update to be more general and clear. But considering my observations I don't know whether the issue should try to work out all the context options, or not, and in which way.
- πΊπ¦Ukraine pingwin4eg Zaporizhia πΊπ¦
I've been thinking about this, and now I see 2 reasons to actually switch from guzzle to a "wrapper in wrapper" way:
- As
http_client
service can be swapped with another one, it is unclear if another service would use same option names as guzzle. - If I understand correctly, guzzle fetches the whole response at once, so using streams could be better in terms of performance (time, memory).
Fix me if I'm wrong.
- As