From:
Operating system: Windows
PHP version: 5.3.3
Package: Streams related
Bug Type: Bug
Bug description:stream_context_set_default() does not work as intended with
stream chaining
Description:
------------
Hello!
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.
Simas
Test script:
---------------
stream_context_set_default(array(
'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
)
)
));
file_get_contents('compress.zlib://http://example.com');
Expected result:
----------------
Default stream options should be used for chained streams as well.
--
Edit bug report at http://bugs.php.net/bug.php?id=52926&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52926&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52926&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52926&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52926&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52926&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52926&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52926&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52926&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52926&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52926&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52926&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52926&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52926&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52926&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52926&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52926&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52926&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52926&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52926&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52926&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52926&r=mysqlcfg