Hello,
I know this isn't as exciting as the GOTO discussion, but I need some help.
I don't know if this just my fault, or if it's a PHP problem.
Consider this:
<?
$fp=fopen('compress.bzip2://http://php.net/backend/notes/all.bz2', 'r');
while (!feof($fp)) {
echo fgets($fp, 4096);
}
fclose($fp);
?>
This gives an error:
Warning: fopen()
1137 bytes of buffered data lost during stream conversion!
in /cvs/livedocs/test_bz.php on line 3
And outputs nothing more. I'm using PHP 5.1.
Whats is wrong here?
Thanks for your time,
Nuno
This gives an error:
Warning:fopen()
1137 bytes of buffered data lost during stream conversion!
in /cvs/livedocs/test_bz.php on line 3And outputs nothing more. I'm using PHP 5.1.
Whats is wrong here?
File a bug for this?
regards,
Derick
This gives an error:
Warning:fopen()
1137 bytes of buffered data lost during stream
conversion!
in /cvs/livedocs/test_bz.php on line 3And outputs nothing more. I'm using PHP 5.1.
Whats is wrong here?
File a bug for this?
regards,
Derick
I just wanted to be sure I wasn't making any newbie mistake :)
Nuno
Most likely a bug in the bzip2 wrapper.
It might not be fixable, and it might be better to use Sara's bzip2
filter from pecl instead.
--Wez.
Hello,
I know this isn't as exciting as the GOTO discussion, but I need some help.
I don't know if this just my fault, or if it's a PHP problem.Consider this:
<?$fp=fopen('compress.bzip2://http://php.net/backend/notes/all.bz2', 'r');
while (!feof($fp)) {
echo fgets($fp, 4096);
}fclose($fp);
?>This gives an error:
Warning:fopen()
1137 bytes of buffered data lost during stream conversion!
in /cvs/livedocs/test_bz.php on line 3And outputs nothing more. I'm using PHP 5.1.
Whats is wrong here?
Thanks for your time,
Nuno
This code is in PHP 5.1. We have plents of time to fix it.
If the PECL code works, why not copy it? I need this to allow anyone to
compile livedocs with notes (without needing the token)
Nuno
----- Original Message -----
Most likely a bug in the bzip2 wrapper.
It might not be fixable, and it might be better to use Sara's bzip2
filter from pecl instead.--Wez.
A filter != wrapper, so copying the code won't work.
Filters are preferred over wrappers for compression/decompression in any case.
I didn't say we weren't going to fix the bug, just that it might not
be fixable; need to check into it.
You don't need it, since you can always do this:
$name = tempnam('/tmp', 'notes');
copy("http://.....", $name);
fopen("compress.bzip://$name", 'r');
--Wez.
This code is in PHP 5.1. We have plents of time to fix it.
If the PECL code works, why not copy it? I need this to allow anyone to
compile livedocs with notes (without needing the token)Nuno
----- Original Message -----
Most likely a bug in the bzip2 wrapper.
It might not be fixable, and it might be better to use Sara's bzip2
filter from pecl instead.--Wez.
Great idea, Wez!
It is working now.
Nuno
----- Original Message -----
A filter != wrapper, so copying the code won't work.
Filters are preferred over wrappers for compression/decompression in any
case.I didn't say we weren't going to fix the bug, just that it might not
be fixable; need to check into it.You don't need it, since you can always do this:
$name = tempnam('/tmp', 'notes');
copy("http://.....", $name);
fopen("compress.bzip://$name", 'r');--Wez.
This code is in PHP 5.1. We have plents of time to fix it.
If the PECL code works, why not copy it? I need this to allow anyone to
compile livedocs with notes (without needing the token)
The point of the token is that people can not get the notes easily. So I
wonder how you're handling this now...
Derick
This code is in PHP 5.1. We have plents of time to fix it.
If the PECL code works, why not copy it? I need this to allow anyone to
compile livedocs with notes (without needing the token)The point of the token is that people can not get the notes easily. So I
wonder how you're handling this now...Derick
They are in all mirrors at: http://php.net/backend/notes/all.bz2