Skip to content

Commit

Permalink
Update FileCacheDriver.php
Browse files Browse the repository at this point in the history
I sometimes get errors in this function if it does not find files
  • Loading branch information
Deltachaos committed Aug 20, 2014
1 parent b74f2bb commit 73d32f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/php/PDepend/Util/Cache/Driver/FileCacheDriver.php
Expand Up @@ -228,8 +228,12 @@ protected function read($file)
public function remove($pattern)
{
$file = $this->getCacheFileWithoutExtension($pattern);
foreach (glob("{$file}*.*") as $f) {
unlink($f);
$glob = glob("{$file}*.*");
// avoid error if we dont find files
if ($glob !== false) {
foreach (glob("{$file}*.*") as $f) {
unlink($f);
}
}
}

Expand Down

0 comments on commit 73d32f3

Please sign in to comment.