From 4a7bd031e5b637fe0049ae9b569c284849f67c2f Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 27 Aug 2011 11:52:29 -0400 Subject: [PATCH] Adding a file_exists() check before unlinking cache files. This prevents issues where two concurrent requests could be clearing the same cache files. Fixes #1936 --- lib/Cake/Cache/Engine/FileEngine.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index c8eafbd0b8c..f81889dcb82 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -240,7 +240,9 @@ public function clear($check) { } $path = $this->_File->getRealPath(); $this->_File = null; - unlink($path); + if (file_exists($path)) { + unlink($path); + } } $dir->close(); return true;