md5_file is not supported by PHP < 4.2.0

javanaut - October 5, 2004 - 15:12
Project:FSCache
Component:Code
Category:bug report
Priority:normal
Assigned:gordon
Status:closed
Description

fscache appears to rely on the md5_file function provided only by php versions 4.2 and greater.

As far as I know, drupal still supports php 4.1.x. The supplemental code to prepend to the fscache.module would be (garnered from the php.net contributed comments for md5_file):

<?php
if (!function_exists('md5_file')) {
   function
md5_file($file_name)
   {
       if (!
file_exists($file_name)) {
          
trigger_error('md5_file(): Unable to open file', E_USER_WARNING);
       } else {
          
$file_string = implode('', file($file_name));
           return
md5($file_string);
       }
   }
}
?>

#1

gordon - October 17, 2004 - 11:50
Assigned to:Anonymous» gordon

Added to cvs

#2

Anonymous - October 31, 2004 - 12:20
 
 

Drupal is a registered trademark of Dries Buytaert.