mirror of
https://github.com/mrclay/minify.git
synced 2025-08-08 23:26:43 +02:00
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).
This commit is contained in:
@@ -30,12 +30,8 @@ class Minify_Cache_File {
|
|||||||
? LOCK_EX
|
? LOCK_EX
|
||||||
: null;
|
: null;
|
||||||
$file = $this->_path . '/' . $id;
|
$file = $this->_path . '/' . $id;
|
||||||
if (is_file($file)) {
|
|
||||||
@unlink($file);
|
|
||||||
}
|
|
||||||
if (! @file_put_contents($file, $data, $flag)) {
|
if (! @file_put_contents($file, $data, $flag)) {
|
||||||
$this->_log("Minify_Cache_File: Write failed to '$file'");
|
$this->_log("Minify_Cache_File: Write failed to '$file'");
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// write control
|
// write control
|
||||||
if ($data !== $this->fetch($id)) {
|
if ($data !== $this->fetch($id)) {
|
||||||
|
Reference in New Issue
Block a user