From eb9e2a364e54b3a1454837138e77f52aaffe1ea5 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 20 Sep 2010 12:17:56 +0200 Subject: [PATCH] Don't hide errors when accessing the GC file, and don't try to do further operations on it if we failed opening it. --- framework/Cache/lib/Horde/Cache/File.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/framework/Cache/lib/Horde/Cache/File.php b/framework/Cache/lib/Horde/Cache/File.php index e59e1dc96..cc369982f 100644 --- a/framework/Cache/lib/Horde/Cache/File.php +++ b/framework/Cache/lib/Horde/Cache/File.php @@ -156,9 +156,11 @@ class Horde_Cache_File extends Horde_Cache_Base // This may result in duplicate entries in horde_cache_gc, but we // will take care of these whenever we do GC and this is quicker // than having to check every time we access the file. - $fp = fopen($this->_dir . '/horde_cache_gc', 'a'); - fwrite($fp, $filename . "\t" . (empty($lifetime) ? 0 : time() + $lifetime) . "\n"); - fclose($fp); + $fp = @fopen($this->_dir . '/horde_cache_gc', 'a'); + if ($fp) { + fwrite($fp, $filename . "\t" . (empty($lifetime) ? 0 : time() + $lifetime) . "\n"); + fclose($fp); + } } } -- 2.11.0