note 41464 deleted from function.stream-get-contents by nlopess
| From: | nlopess@php.net | Date: | Fri, 13 Aug 2004 23:21:18 +0000 |
| Subject: | note 41464 deleted from function.stream-get-contents by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74595@lists.php.net to get a copy of this message | ||
Note Submitter:
----
This function is a generalized version of the otherwise equivalent function:
string fread($resource, $maxlength)
However the stream_* functions allows more fine-grained tuning of what fopen() performs silently.
In PHP 4.3.* all file resources are now implemented as stream resources, meaning that they accept a
"zcontext" where options can be set to specify request meta-data, and that a open file can
be now queried for its meta-data (to get its URI i.e. filename, wrapper type i.e. protocol, filters,
wrapper-data i.e. reply headers in HTTP)...
It's just a shame that this function has no timeout parameter (same thing for the fopen()
wrapper for which the timeout parameter could be set in the zcontext options).
To add the timeout, one must use the stream_get_contents() or stream_get_line() supplementary APIs
added in PHP 5.