]> granicus.if.org Git - php/commitdiff
if (!function_exists('md5_file')) { ...
authorTomas V.V.Cox <cox@php.net>
Sun, 31 Mar 2002 19:04:26 +0000 (19:04 +0000)
committerTomas V.V.Cox <cox@php.net>
Sun, 31 Mar 2002 19:04:26 +0000 (19:04 +0000)
pear/PEAR/Packager.php

index c314e55f8d953f39f3c634cccb8262bf86dcfb49..f21192dac7b8c941b97a9ccf5f08f6ee3970a823 100644 (file)
@@ -144,4 +144,13 @@ class PEAR_Packager extends PEAR_Common
     // }}}
 }
 
+if (!function_exists('md5_file')) {
+    function &md5_file($file) {
+        if (!$fd = @fopen($file, 'r')) {
+            return false;
+        }
+        return md5(fread($fd, filesize($file)));
+    }
+}
+
 ?>
\ No newline at end of file