note 41464 added to function.stream-get-contents

From: Date: Sun, 11 Apr 2004 14:16:49 +0000
Subject: note 41464 added to function.stream-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-67977@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.stream-get-contents.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41464 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41464&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41464&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67977) next »