note 82601 added to function.stream-wrapper-register
| From: | phrank at osu1 dot php dot net | Date: | Thu, 17 Apr 2008 20:38:17 +0000 |
| Subject: | note 82601 added to function.stream-wrapper-register | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138422@lists.php.net to get a copy of this message | ||
Actually, I don't know if there's a better way to figure out if stream_read() was called
by fgets() or e.g. fread() than this one:
public function stream_read($count)
{
$bt = debug_backtrace();
if(($bt[0]['function'] == 'stream_read') &&
($bt[1]['function'] == 'fgets'))
{
$pos = strpos($GLOBALS[$this->varname], "\n", $this->position);
$retval = substr($GLOBALS[$this->varname], $this->position, ($pos > $count)
? $count : $pos+1);
}
else
{
$retval = substr($GLOBALS[$this->varname], $this->position, $count);
}
$this->position += strlen($retval);
return (string)$retval;
}
----
Server IP: 217.13.201.10
Probable Submitter: 88.78.164.162
----
Manual Page -- http://www.php.net/manual/en/function.stream-wrapper-register.php
Edit -- https://master.php.net/note/edit/82601
Del: integrated -- https://master.php.net/note/delete/82601/integrated
Del: useless -- https://master.php.net/note/delete/82601/useless
Del: bad code -- https://master.php.net/note/delete/82601/bad+code
Del: spam -- https://master.php.net/note/delete/82601/spam
Del: non-english -- https://master.php.net/note/delete/82601/non-english
Del: in docs -- https://master.php.net/note/delete/82601/in+docs
Del: other reasons-- https://master.php.net/note/delete/82601
Reject -- https://master.php.net/note/reject/82601
Search -- https://master.php.net/manage/user-notes.php