#27508 [Com]: feof() broken for user-defined streams

2004-10-29 Thread cpuidle at gmx dot de
 ID:   27508
 Comment by:   cpuidle at gmx dot de
 Reported By:  adam at trachtenberg dot com
 Status:   Assigned
 Bug Type: Network related
 Operating System: *
 PHP Version:  5CVS-2004-03-05
 Assigned To:  wez
 New Comment:

The issue is still present in PHP 5.0.1- any way to get this fixed?

Thanks,
Andi


Previous Comments:


[2004-09-20 21:23:21] contact at zeninteractif dot com

I've made my own Streams Wrappers that returns data as xml.
I use this streams with W3C include !

When I resolve xinclude using original domDocument class all working
well with this method :

function stream_eof() {
  return $this->position >= strlen($this->data);
}

If I resolve xinclude using domDocument extended class
(with my own xinclude method) I must use this method In all my streams
handlers classes :

function stream_eof() {
  return $this->position < strlen($this->data);
}

My xinclude method use this code : 

while (!feof($fp)) {
  $this->data.=fread($fp,1024);
} 

Maybe If I use file_get_contents function all will work well !
It's a performance problem ..

file_get_contents function + stream_get_meta_data function = 2 files
pointers !

my current method = 1 file pointer !



[2004-04-01 14:09:57] tthiery at yahoo dot de

5.0.0rc1 win32 same error as above

custom application on base of manual example.

should be
return $this->position >= strlen($this->data);

if I reverse the return value of stream_eof all works fine

return $this->position < strlen($this->data);

Perhaps just a small ! is missing.



[2004-03-09 11:32:53] adam at trachtenberg dot com

Oops. Wrong file extension. Should be: 

http://www.trachtenberg.com/patches/bug27508.txt



[2004-03-09 11:31:38] adam at trachtenberg dot com

Here's an example where the class is just a wrapper 
around fopen(), fread(), fwrite(), etc.

It's at http://www.trachtenberg.com/patches/
bug27508.php.

In PHP 4, you get:

line1
line2
line3

PHP 5 outputs no data.



[2004-03-09 08:47:27] [EMAIL PROTECTED]

Wez, the fix didn't quite fix it.

Adam, can you please come up with a test case and send it to internals@
? (The one in manual is a bit long, could it be made any shorter?)




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/27508

-- 
Edit this bug report at http://bugs.php.net/?id=27508&edit=1


#27508 [Com]: feof() broken for user-defined streams

2004-09-20 Thread contact at zeninteractif dot com
 ID:   27508
 Comment by:   contact at zeninteractif dot com
 Reported By:  adam at trachtenberg dot com
 Status:   Assigned
 Bug Type: Network related
 Operating System: *
 PHP Version:  5CVS-2004-03-05
 Assigned To:  wez
 New Comment:

I've made my own Streams Wrappers that returns data as xml.
I use this streams with W3C include !

When I resolve xinclude using original domDocument class all working
well with this method :

function stream_eof() {
  return $this->position >= strlen($this->data);
}

If I resolve xinclude using domDocument extended class
(with my own xinclude method) I must use this method In all my streams
handlers classes :

function stream_eof() {
  return $this->position < strlen($this->data);
}

My xinclude method use this code : 

while (!feof($fp)) {
  $this->data.=fread($fp,1024);
} 

Maybe If I use file_get_contents function all will work well !
It's a performance problem ..

file_get_contents function + stream_get_meta_data function = 2 files
pointers !

my current method = 1 file pointer !


Previous Comments:


[2004-04-01 14:09:57] tthiery at yahoo dot de

5.0.0rc1 win32 same error as above

custom application on base of manual example.

should be
return $this->position >= strlen($this->data);

if I reverse the return value of stream_eof all works fine

return $this->position < strlen($this->data);

Perhaps just a small ! is missing.



[2004-03-09 11:32:53] adam at trachtenberg dot com

Oops. Wrong file extension. Should be: 

http://www.trachtenberg.com/patches/bug27508.txt



[2004-03-09 11:31:38] adam at trachtenberg dot com

Here's an example where the class is just a wrapper 
around fopen(), fread(), fwrite(), etc.

It's at http://www.trachtenberg.com/patches/
bug27508.php.

In PHP 4, you get:

line1
line2
line3

PHP 5 outputs no data.



[2004-03-09 08:47:27] [EMAIL PROTECTED]

Wez, the fix didn't quite fix it.

Adam, can you please come up with a test case and send it to internals@
? (The one in manual is a bit long, could it be made any shorter?)




[2004-03-07 20:34:49] adam at trachtenberg dot com

Sorry. Still broken.



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/27508

-- 
Edit this bug report at http://bugs.php.net/?id=27508&edit=1


#27508 [Com]: feof() broken for user-defined streams

2004-04-01 Thread tthiery at yahoo dot de
 ID:   27508
 Comment by:   tthiery at yahoo dot de
 Reported By:  adam at trachtenberg dot com
 Status:   Assigned
 Bug Type: Network related
 Operating System: *
 PHP Version:  5CVS-2004-03-05
 Assigned To:  wez
 New Comment:

5.0.0rc1 win32 same error as above



custom application on base of manual example.



should be

return $this->position >= strlen($this->data);



if I reverse the return value of stream_eof all works fine



return $this->position < strlen($this->data);



Perhaps just a small ! is missing.


Previous Comments:


[2004-03-09 11:32:53] adam at trachtenberg dot com

Oops. Wrong file extension. Should be: 



http://www.trachtenberg.com/patches/bug27508.txt



[2004-03-09 11:31:38] adam at trachtenberg dot com

Here's an example where the class is just a wrapper 

around fopen(), fread(), fwrite(), etc.



It's at http://www.trachtenberg.com/patches/

bug27508.php.



In PHP 4, you get:



line1

line2

line3



PHP 5 outputs no data.



[2004-03-09 08:47:27] [EMAIL PROTECTED]

Wez, the fix didn't quite fix it.



Adam, can you please come up with a test case and send it to internals@
? (The one in manual is a bit long, could it be made any shorter?)





[2004-03-07 20:34:49] adam at trachtenberg dot com

Sorry. Still broken.



[2004-03-07 16:59:08] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Most likely fixed now



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/27508

-- 
Edit this bug report at http://bugs.php.net/?id=27508&edit=1