webmozarts / glob

A PHP implementation of Ant's glob.
MIT License
254 stars 16 forks source link

GLOB_BRACE not defined in Alpine #15

Closed marcosh closed 3 years ago

marcosh commented 6 years ago

It looks like that GLOB_BRACE is not supported in Alpine Linux (see https://bugs.php.net/bug.php?id=72095).

This leads to the following warning

Warning: glob() expects parameter 2 to be integer, string given in /app/vendor/webmozart/glob/src/Iterator/GlobIterator.php on line 55

In the link above there is also a proposed workaround to avoid such a problem

stereomon commented 4 years ago

I have the same issue. @webmozart will you provide a fix for it or do we have to solve this on our own?

sanmai commented 4 years ago

A quote:

The workaround is not hard to implement (https://github.com/zendframework/zend-stdlib/pull/59):

Instead of using directly

... GLOB_BRACE ...

it's just to check if it's defined before otherwise defaults to 0, like this:

... defined('GLOB_BRACE') ? GLOB_BRACE : 0 ...

As shown above, it's the way the issue was solved in Zend Framework.