Skip to content

Commit

Permalink
Add coding standards ignore comments to FileEngine
Browse files Browse the repository at this point in the history
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 0891073
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/Cake/Cache/Engine/FileEngine.php
Expand Up @@ -210,7 +210,10 @@ public function delete($key) {
} }
$path = $this->_File->getRealPath(); $path = $this->_File->getRealPath();
$this->_File = null; $this->_File = null;

//@codingStandardsIgnoreStart
return @unlink($path); return @unlink($path);
//@codingStandardsIgnoreEnd
} }


/** /**
Expand Down Expand Up @@ -289,9 +292,12 @@ protected function _clearDirectory($path, $now, $threshold) {
} }
} }
if ($file->isFile()) { if ($file->isFile()) {
$_path = $file->getRealPath(); $filePath = $file->getRealPath();
$file = null; $file = null;
@unlink($_path);
//@codingStandardsIgnoreStart
@unlink($filePath);
//@codingStandardsIgnoreEnd
} }
} }
} }
Expand Down Expand Up @@ -411,7 +417,11 @@ public function clearGroup($group) {
$containsGroup = strpos($object->getPathName(), DS . $group . DS) !== false; $containsGroup = strpos($object->getPathName(), DS . $group . DS) !== false;
$hasPrefix = strpos($object->getBaseName(), $this->settings['prefix']) === 0; $hasPrefix = strpos($object->getBaseName(), $this->settings['prefix']) === 0;
if ($object->isFile() && $containsGroup && $hasPrefix) { if ($object->isFile() && $containsGroup && $hasPrefix) {
@unlink($object->getPathName()); $path = $object->getPathName();
$object = null;
//@codingStandardsIgnoreStart
@unlink($path);
//@codingStandardsIgnoreEnd
} }
} }
return true; return true;
Expand Down

0 comments on commit 0891073

Please sign in to comment.