Skip to content

Commit

Permalink
Updated Filesystem to check for glob() error.
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelijusrozenas committed Aug 9, 2015
1 parent 0553c9b commit ea1d0f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ComponentInstaller/Util/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ public function recursiveGlob($pattern, $flags = 0)

// Check if this is to be recursive.
if (strpos($pattern, '**') !== FALSE) {
foreach (glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
$files = array_merge($files, $this->recursiveGlob($dir.DIRECTORY_SEPARATOR.basename($pattern), $flags));
}
$dirs = glob(dirname($pattern).DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR|GLOB_NOSORT);
if ($dirs) {
foreach ($dirs as $dir) {
$files = array_merge($files, $this->recursiveGlob($dir.DIRECTORY_SEPARATOR.basename($pattern), $flags));
}
}
}

return $files;
Expand Down

0 comments on commit ea1d0f8

Please sign in to comment.