Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from ceesvanegmond/pr/21
Browse files Browse the repository at this point in the history
Fix return false php glob
  • Loading branch information
ceesvanegmond committed Apr 17, 2014
2 parents 59466c4 + d4996fe commit cd570f0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/CeesVanEgmond/Minify/Providers/BaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,15 @@ protected function countModificationTime()
protected function removeOldFiles()
{
$pattern = $this->outputDir . $this->getHashedFilename() . '*';
foreach (glob($pattern) as $file)
$find = glob($pattern);

if( is_array($find) && count($find) )
{
if ( ! unlink($file) ) {
throw new CannotRemoveFileException("File '{$file}' cannot be removed");
foreach ($find as $file)
{
if ( ! unlink($file) ) {
throw new CannotRemoveFileException("File '{$file}' cannot be removed");
}
}
}
}
Expand Down

0 comments on commit cd570f0

Please sign in to comment.