Permalink
Browse files

Add coding standards ignore comments to FileEngine

We normally disallow error supression but it is the only way to
atomically delete files.
  • Loading branch information...
markstory committed Sep 6, 2013
1 parent af3065d commit 0891073d191f179a024c6c1f372082d489c96938
Showing with 13 additions and 3 deletions.
  1. +13 −3 lib/Cake/Cache/Engine/FileEngine.php
@@ -210,7 +210,10 @@ public function delete($key) {
}
$path = $this->_File->getRealPath();
$this->_File = null;
+
+ //@codingStandardsIgnoreStart
return @unlink($path);
+ //@codingStandardsIgnoreEnd
}
/**
@@ -289,9 +292,12 @@ protected function _clearDirectory($path, $now, $threshold) {
}
}
if ($file->isFile()) {
- $_path = $file->getRealPath();
+ $filePath = $file->getRealPath();
$file = null;
- @unlink($_path);
+
+ //@codingStandardsIgnoreStart
+ @unlink($filePath);
+ //@codingStandardsIgnoreEnd
}
}
}
@@ -411,7 +417,11 @@ public function clearGroup($group) {
$containsGroup = strpos($object->getPathName(), DS . $group . DS) !== false;
$hasPrefix = strpos($object->getBaseName(), $this->settings['prefix']) === 0;
if ($object->isFile() && $containsGroup && $hasPrefix) {
- @unlink($object->getPathName());
+ $path = $object->getPathName();
+ $object = null;
+ //@codingStandardsIgnoreStart
+ @unlink($path);
+ //@codingStandardsIgnoreEnd
}
}
return true;

0 comments on commit 0891073

Please sign in to comment.