From db60321f8b5a04306c19cac6cae455a22cb0097c Mon Sep 17 00:00:00 2001 From: jrchamp Date: Tue, 24 Jan 2012 17:18:46 -0500 Subject: [PATCH] Don't need to unlink file because file_put_contents will handle that. Also, don't return false after file_put_contents fails in case it creates a zero size file (use the existing "does the data match" check to ensure that the zero size file gets unlinked). --- min/lib/Minify/Cache/File.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/min/lib/Minify/Cache/File.php b/min/lib/Minify/Cache/File.php index a45ba85..3fa6b18 100644 --- a/min/lib/Minify/Cache/File.php +++ b/min/lib/Minify/Cache/File.php @@ -30,12 +30,8 @@ class Minify_Cache_File { ? LOCK_EX : null; $file = $this->_path . '/' . $id; - if (is_file($file)) { - @unlink($file); - } if (! @file_put_contents($file, $data, $flag)) { $this->_log("Minify_Cache_File: Write failed to '$file'"); - return false; } // write control if ($data !== $this->fetch($id)) {