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 #23 from ceesvanegmond/develop
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
ceesvanegmond committed Apr 17, 2014
2 parents fd72081 + cd570f0 commit aa27adb
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 aa27adb

Please sign in to comment.