Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Check if GLOB_BRACE is defined before using it #58 #59

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

cusspvz
Copy link
Contributor

@cusspvz cusspvz commented Apr 12, 2016

This commit refers to the issue #58 and fixes an exception that was arising up on
systems based on MUSL (and probably other UNIX based rather than GNU Linux)

  [Exception]
  Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /magento/vendor/zendframework/zend-stdlib/src/Glob.php on line 64

closes #58

This commit refers to the issue zendframework#58 and fixes an exception that was arising up on
systems based on MUSL (and probably other UNIX based rather than GNU Linux)

```
  [Exception]
  Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /magento/vendor/zendframework/zend-stdlib/src/Glob.php on line 64
```
@@ -61,7 +61,7 @@ protected static function systemGlob($pattern, $flags)
self::GLOB_NOSORT => GLOB_NOSORT,
self::GLOB_NOCHECK => GLOB_NOCHECK,
self::GLOB_NOESCAPE => GLOB_NOESCAPE,
self::GLOB_BRACE => GLOB_BRACE,
self::GLOB_BRACE => defined('GLOB_BRACE') ? GLOB_BRACE : 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does GLOB_BRACE always default to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I've tested it, the error went away and it did its job. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the flag comes from the underlying lib, not from PHP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before posting the issue here, I've checked some approaches taken by other softwares and they did the same and defaulted it to 0.

http://git.alpinelinux.org/cgit/aports/plain/main/asterisk/musl-glob-compat.patch
http://lists.alpinelinux.org/alpine-aports/1379.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for digging out the links!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're welcome. Wouldn't you please mind to notice me when the next release with this is launched? Because I've did that change on a docker container after running compose and I will need to remove it later.

Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cusspvz you should get a notification when this is merged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so you land all PRs just before releasing the version? I'm used to get them landed and wait 'til the next release, thats why I've requested you to notice me. 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cusspvz We're now typically doing bugfix releases immediately following merges. 😄

@Ocramius Ocramius added the bug label Apr 12, 2016
@Ocramius Ocramius added this to the 2.7.7 milestone Apr 12, 2016
@weierophinney weierophinney merged commit 2cc71cb into zendframework:master Apr 12, 2016
weierophinney added a commit that referenced this pull request Apr 12, 2016
Check if GLOB_BRACE is defined before using it #58
weierophinney added a commit that referenced this pull request Apr 12, 2016
weierophinney added a commit that referenced this pull request Apr 12, 2016
weierophinney added a commit that referenced this pull request Apr 12, 2016
weierophinney added a commit that referenced this pull request Apr 12, 2016
@weierophinney
Copy link
Member

Released with each of 2.7.7 and 3.0.1.

@cusspvz
Copy link
Contributor Author

cusspvz commented Apr 12, 2016

@weierophinney @Ocramius Thanks for landing and releasing! Have a nice week. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLOB_BRACE support on Alpine and others musl-based distros
3 participants