go to bug id or search bugs for
I was trying to add gzip/deflate support to standard HTTP streams (code attached).
It seems stream_context_set_default() works fine as long as stream wrappers are
not chained, like when used with "compress.zlib://" it will not use options as set
with this function and will revert to php default ones.
'http' => array(
'protocol_version' => 1.1, // HTTP 1.1 compatible
'header' => array(
'Connection: close', // No Keep-Alive
'Accept-Encoding: gzip, deflate' // We support content compression
Default stream options should be used for chained streams as well.
Add a Patch
Add a Pull Request
Fixed in attached patch.
The problem is php_stream_gzopen doesn't forward the context when opening the inner stream; this isn't limited to default contexts.
The following patch has been added/updated:
Patch Name: zlib_inner_open
That was quick! I imagine this patch will fix the following code as well?
stream_context_create(array('http' => ...))
Automatic comment from SVN on behalf of pajoye
Log: - fix bug #52926, zlib fopen wrapper does not use the context
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.