PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PHP » PHP_Compat » Bug #3190

[PATCH] md5_file() depends on possibly nonexistent file_get_contents()

Details

Submitted2005-01-13 20:15 UTC
Fromieure at php dot net
Assignedaidan
StatusClosed
PackagePHP_Compat
PHP VersionIrrelevant
OSLinux
Roadmaps1.6.0a1

Comments

[2005-01-13 20:15 UTC] ieure at php dot net

Description:
------------
md5_file() is loaded when the 4.2.0 compat. profile is
loaded, but it depends on file_get_contents(), which
wasn't added until PHP 4.3.0.

This patch loads file_get_contents() in md5_file(). It's
against CVS:
http://atomized.org/PEAR/Patches/PHP_Compat-md5_file.patch

Reproduce code:
---------------
<?php
require_once 'PHP/Compat.php';
PHP_Compat::loadVersion('4.2.0');

$res = md5_file('/tmp/foo');
?>

Expected result:
----------------
md5_file() should return the MD5 hash of '/tmp/foo'.

Actual result:
--------------
Fatal error: Call to undefined function:
file_get_contents()
in /tmp/compat/PHP_Compat-1.3.1/Compat/Function/md5_file.php
on line 52