From 6b957646192bf72a5f319c9eea723929095ed9ec Mon Sep 17 00:00:00 2001
From: mtak3 <mtak@tyrellsys.com>
Date: Tue, 19 Aug 2014 17:32:25 +0900
Subject: [PATCH] Ignore RuntimeException

RuntimeException is thrown at race condition.
However, since for the processing at Garbage Collection, other processes
is determined that the expired.
this process is acceptable to ignore the RuntimeException even if there is
missing file.
---
 lib/Cake/Cache/Engine/FileEngine.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php
index 684ab1583..43eddc5b2 100644
--- a/lib/Cake/Cache/Engine/FileEngine.php
+++ b/lib/Cake/Cache/Engine/FileEngine.php
@@ -275,7 +275,11 @@ class FileEngine extends CacheEngine {
 			if (!file_exists($filePath) || is_dir($filePath)) {
 				continue;
 			}
-			$file = new SplFileObject($path . $entry, 'r');
+			try {
+				$file = new SplFileObject($path . $entry, 'r');
+			} catch (RuntimeException $e) {
+				continue;
+			}
 
 			if ($threshold) {
 				$mtime = $file->getMTime();