go-pear.phar is working 100%
| From: | Greg Beaver | Date: | Sun, 14 Aug 2005 07:52:26 +0000 |
| Subject: | go-pear.phar is working 100% | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-39347@lists.php.net to get a copy of this message | ||
Hi all,
I just had a flash of debugging insight and found the problem with
go-pear.phar. It is now working in my tests on both windows and linux.
It requires PHP 5.1 in order to function properly, so don't tell me it
doesn't work in earlier PHP versions.
http://pear.chiaraquartet.net/go-pear.phar
testing is appreciated. This go-pear.phar installs the cutting edge CVS
versions of PEAR, PEAR_ErrorStack, Console_Getopt and Archive_Tar.
Incidentally, the problem I had been encountering for well over a month
was a bugfix/BC break in PHP 5.1.0's implementation of streams. If you
have code like this:
$data = fread($fp, filesize($file));
and $fp is a stream (like 'phar://go-pear.phar/PEAR.php' for instance),
fread() will silently return no more than exactly 16383 bytes of the
file. Earlier PHP versions returned the whole file. The solution, of
course, is to use file_get_contents() if it is available. This,
incidentally, is not a bug according to Wez, which is why we are
dropping PHP 5.0.x and 4.3.x support from PHP_Archive - just too much of
a hassle working around the many bugs and BC breaks between these
versions. Streams handling is far superior in PHP 5.1.0, along with
just about everything else.
Greg