-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Skip Glob brace test when GLOB_BRACE is unavailable #30839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
936681b
to
ce38fe3
Compare
@@ -339,6 +339,10 @@ public function testInWithNonDirectoryGlob() | |||
|
|||
public function testInWithGlobBrace() | |||
{ | |||
if (!\defined('GLOB_BRACE')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add such a test in the code to alert the developer of the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we can reliably implement this without a glob parser. We already have a glob parser, but not for this purpose (see Glob::toRegex()
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fyi, Zend has implemented a fallback in it's stdlib: https://github.com/zendframework/zend-stdlib/blob/master/src/Glob.php#L89-L168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good as is, let's not make our maintainer's life more complex than needed, Solaris users can contribute more code if they want to :)
Thank you @wouterj. |
…terj) This PR was merged into the 3.4 branch. Discussion ---------- Skip Glob brace test when GLOB_BRACE is unavailable | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | n/a From [PHP.net](https://www.php.net/glob): > Note: The GLOB_BRACE flag is not available on some non GNU systems, like Solaris. This means running the testsuite in e.g. a php-alpine container fails atm. This test should be skipped in these environments. Commits ------- ce38fe3 Skip Glob brace test when GLOB_BRACE is unavailable
From PHP.net:
This means running the testsuite in e.g. a php-alpine container fails atm. This test should be skipped in these environments.