PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » File_Archive » Bug #3894

pb with PHP 4.x

Details

Submitted2005-03-20 20:42 UTC
Frommos_fr at yahoo dot fr
Assignedvincentlascaux
StatusClosed
PackageFile_Archive
PHP Version4.3.3
OSWin 98
Roadmaps(Not assigned)

Comments

[2005-03-20 20:42 UTC] mos_fr at yahoo dot fr

Description:
------------

I have an error when I put just an require or require_once instruction...

It is seems to be a problem with declaration of functions : in the archive.php :
function read($URL, $symbolic = null, $uncompression = 0,
$directoryDepth = -1, &$source = null)

This syntax is only allowed as of PHP5 IIRC (parameters passed by-ref cannot have a default value in PHP4).
And so on for other functions...

So, it's a bug if the package has no PHP5 dependency, and I see Php 4 and Php 5 in the API documentation...

Reproduce code:
---------------
function read($URL, $symbolic = null, $uncompression = 0,
$directoryDepth = -1, &$source = null)

[2005-04-08 10:21 UTC] lascauv4 at cti dot ecp dot fr

Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/File_Archive

I split the read function to

function read($URL, $symbolic = null, $uncompression = 0,
$directoryDepth = -1)

(which act as if the $source parameter was ommited) and

function readSource(&$source, $URL, $symbolic = null, $uncompression = 0, $directoryDepth = -1)