From 0891073d191f179a024c6c1f372082d489c96938 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 6 Sep 2013 12:19:23 -0400 Subject: [PATCH] Add coding standards ignore comments to FileEngine We normally disallow error supression but it is the only way to atomically delete files. --- lib/Cake/Cache/Engine/FileEngine.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index 35b256bd8f3..efd7583e9ba 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/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;