I go to sales/mail to see if I can send out a "test" email. I click on mail and it takes me directly to an error page that says:
Line21-39 reads like this :Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/MYSITE/MYSITE.com/system/library/cache.php on line 31
Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 8274861 bytes) in /home/MYSITE/MYSITE.com/system/library/cache.php on line 48
Code: Select all
public function get($key) {
$files = glob(DIR_CACHE . 'cache.' . $key . '.*');
if ($files) {
foreach ($files as $file) {
$cache = '';
$handle = fopen($file, 'r');
if ($handle) {
$cache = fread($handle, filesize($file)); <--- Line 31
fclose($handle);
}
return unserialize($cache);
}
}
}
Code: Select all
public function set($key, $value) {
$this->delete($key);
$file = DIR_CACHE . 'cache.' . $key . '.' . (time() + $this->expire);
$handle = fopen($file, 'w');
fwrite($handle, serialize($value)); <-- line 48
fclose($handle);
}
What SHOULD the above lines look like when functioning properly so I can "correct" them ?