Home » File Formats » Archive_Zip » Bug #3893
require_one 'PEAR.php' not always needed?
Details
| Request #3893 | require_one 'PEAR.php' not always needed? |
|---|---|
| Submitted | 2005-03-20 15:43 UTC |
| From | sidney at sidney dot com |
| Status | Suspended |
| Package | Archive_Zip |
| PHP Version | 4.3.10 |
| OS | Any |
| Roadmaps | (Not assigned) |
Comments
[2005-03-20 15:43 UTC] sidney at sidney dot com
Description:
------------
I'm using Zip.php downloaded from cvs on a web host that does not have Pear installed. I had to comment out the require_once 'PEAR.php' in order to use it.
I notice that the only place Pear is needed is when there is no zlib, i.e., on line 134
if (!extension_loaded('zlib')) {
PEAR::loadExtension('zlib');
}
My ISP built PHP with zlib and without Pear.
By making the require_once only be called when !extension_loaded('zlib') this file will be useful without modification on more hosts.
Reproduce code:
---------------
On a system without Pear installed, with zlib installed, and with Zip.php copied to the current directory, try to run a file with the line:
require_once "Zip.php";
Expected result:
----------------
No error
Actual result:
--------------
An error from the require_once 'PEAR.php'; line in Zip.php when it can't find PEAR.php