Skip to content

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

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Apr 2, 2019

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:

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.

@wouterj wouterj force-pushed the fix/finder-glob-brace branch from 936681b to ce38fe3 Compare April 2, 2019 19:55
@@ -339,6 +339,10 @@ public function testInWithNonDirectoryGlob()

public function testInWithGlobBrace()
{
if (!\defined('GLOB_BRACE')) {
Copy link
Member

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?

Copy link
Member

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())

Copy link
Member Author

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

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Apr 3, 2019
Copy link
Member

@nicolas-grekas nicolas-grekas left a 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 :)

@fabpot
Copy link
Member

fabpot commented Apr 3, 2019

Thank you @wouterj.

@fabpot fabpot merged commit ce38fe3 into symfony:3.4 Apr 3, 2019
fabpot added a commit that referenced this pull request Apr 3, 2019
…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
@wouterj wouterj deleted the fix/finder-glob-brace branch April 3, 2019 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants