note 104122 added to wrappers
| From: | kwedeth at gmail dot com | Date: | Wed, 25 May 2011 01:04:04 +0000 |
| Subject: | note 104122 added to wrappers | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180009@lists.php.net to get a copy of this message | ||
When daisy-chaining wrappers, I've found that the stream context only applies to the outside
wrapper. For example, the following code will not work:
<?php
$options = array('http'=>array('header'=>"Accept-Encoding:
gzip\r\n"));
$context = stream_context_create($options);
$html = file_get_contents('compress.zlib://http://website.com/resource.gz', 0, $context);
?>
The context in this case is useless for the compress.zlib:// wrapper but it does not get applied to
http:// and the header will not be sent.
----
Server IP: 69.147.83.197
Probable Submitter: 216.121.147.105
----
Manual Page -- http://www.php.net/manual/en/wrappers.php
Edit -- https://master.php.net/note/edit/104122
Del: integrated -- https://master.php.net/note/delete/104122/integrated
Del: useless -- https://master.php.net/note/delete/104122/useless
Del: bad code -- https://master.php.net/note/delete/104122/bad+code
Del: spam -- https://master.php.net/note/delete/104122/spam
Del: non-english -- https://master.php.net/note/delete/104122/non-english
Del: in docs -- https://master.php.net/note/delete/104122/in+docs
Del: other reasons-- https://master.php.net/note/delete/104122
Reject -- https://master.php.net/note/reject/104122
Search -- https://master.php.net/manage/user-notes.php