Skip to content

Commit

Permalink
Fix for support on Alpine and others musl-based distros (#44)
Browse files Browse the repository at this point in the history
* Fix for support on Alpine and others musl-based distros

Alpine doesn't support GLOB_BRACE since it is using musl libc instead of GNU libc.

* Refactoring
  • Loading branch information
Igor Kuznetsov authored and reisraff committed Jul 3, 2018
1 parent 1e59352 commit 9ebf88f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bin/phulp.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,16 @@
}
}

$phulpFiles = glob('[P,p]hulp[Ff]il{e,e.php}', GLOB_BRACE);
if (defined('GLOB_BRACE')) {
$phulpFiles = glob('[P,p]hulp[Ff]il{e,e.php}', GLOB_BRACE);
} else {
$phulpFiles = [];
$finder = \Symfony\Component\Finder\FindeR::create()
->name('~^phulpfile(\.php)*$~i')->depth('< 1')->in(getcwd());
foreach ($finder->getIterator() as $file) {
$phulpFiles[] = $file->getFilename();
}
}

if (count($phulpFiles) > 1) {
$out::err(sprintf(
Expand Down

0 comments on commit 9ebf88f

Please sign in to comment.