ID: 43510
User updated by: dz at bitxtender dot com
Reported By: dz at bitxtender dot com
-Status: Feedback
+Status: Open
Bug Type: Streams related
Operating System: *
PHP Version: 5.2.5
New Comment:
Thanks Jani. Will try ASAP.
Previous Comments:
------------------------------------------------------------------------
[2008-10-26 23:34:03] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2007-12-06 17:37:54] dz at bitxtender dot com
The simple reason why this must work is because one might want to
serialize an object with a file pointer, and that can only be done by
grabbing the meta data on sleep, and restoring the stream on wakeup.
But fopen() on an HTTP resource with r+ of course gives a warning that
the stream does not support writing!
I stumbled across this when someone pointed out that in Agavi, it's not
possible to cache a response that is streaming content from an HTTP
resource. Check
http://trac.agavi.org/browser/branches/0.11/src/response/AgaviResponse.c
lass.php?rev=2205#L55 for some "real-life" code that relies on this ;)
Also, it never hurts to have things working 100% properly ;)
------------------------------------------------------------------------
[2007-12-06 17:26:52] helly@php.net
Reopening after discussions. David, please explain the reasoning
------------------------------------------------------------------------
[2007-12-06 13:50:09] helly@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Why should the exact mode matter?
------------------------------------------------------------------------
[2007-12-06 03:15:34] dz at bitxtender dot com
Description:
------------
When an fopen() is done on an HTTP URL with mode "r", the
stream_get_meta_data() result returns "r+"
Reproduce code:
---------------
$meta = stream_get_meta_data(fopen('http://www.google.com/', 'r'));
var_dump($meta['mode']);
Expected result:
----------------
string 'r' (length=1)
Actual result:
--------------
string 'r+' (length=2)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43510--
Edit this bug report at http://bugs.php.net/?id=43510&edit=1