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

GLOB_BRACE support on Alpine and others musl-based distros #58

Closed
cusspvz opened this issue Apr 12, 2016 · 6 comments · Fixed by #59
Closed

GLOB_BRACE support on Alpine and others musl-based distros #58

cusspvz opened this issue Apr 12, 2016 · 6 comments · Fixed by #59

Comments

@cusspvz
Copy link
Contributor

cusspvz commented Apr 12, 2016

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

This module is affecting some installations since it depends on it. Is there a chance to work around it?

@Ocramius
Copy link
Member

Is there a chance to work around it?

Seems like calling glob() multiple times and then doing an array_merge() is the solution for those systems. We cannot support it ourselves though, as we'd have to rewrite a glob implementation in userland then :(

@cusspvz
Copy link
Contributor Author

cusspvz commented Apr 12, 2016

@Ocramius thanks for your super fast response!!

Well, seems you already have a fallback, but in fact it also seems the system isn't complaining about the implementation but instead about the non declarated use.

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

Shouldn't this have a defined('GLOB_BRACE') check?

@Ocramius
Copy link
Member

@cusspvz that should be quite easy to fix, yes (@DASPRiD built some workarounds before 2.0 to support old UNIX systems that didn't have GLOB_BRACE). Can you attempt a fix?

Also, remember to always link absolute code reference: using just master causes links to be broken on long term (due to code moving around)

cusspvz pushed a commit to cusspvz/zend-stdlib that referenced this issue Apr 12, 2016
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
```
@cusspvz
Copy link
Contributor Author

cusspvz commented Apr 12, 2016

Also, remember to always link absolute code reference: using just master causes links to be broken on long term (due to code moving around)

@Ocramius can you please explain what you meant here? Didn't understood, sorry.

@Ocramius
Copy link
Member

@cusspvz look at the links in your comment above: I modified them to point at a specific SHA1 of the repo

@cusspvz
Copy link
Contributor Author

cusspvz commented Apr 12, 2016

Ohh, I got it now! Thanks!!

weierophinney added a commit that referenced this issue Apr 12, 2016
Check if GLOB_BRACE is defined before using it #58
weierophinney added a commit that referenced this issue Apr 12, 2016
weierophinney pushed a commit that referenced this issue 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
```
nicolas-grekas added a commit to symfony/symfony that referenced this issue Feb 11, 2018
This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes #26091).

Discussion
----------

Update Repository Symlink Helper

The `link` script is super-useful (thanks @dunglas!) for development - but for some it's unusable in its current form due to the use of `GLOB_BRACE` which is [unavailable on certain platforms](zendframework/zend-stdlib#58 (comment)) (such as Alpine) and is a platform-specific problem that will not be fixed in future versions of PHP.

I know the code is a little condensed and not the easiest to read, but I thought that wasn't really an issue considering this is just a development helper script and not part of the 'official' Symfony code base.

| Q             | A
| ------------- | ---
| Branch?       | `3.3`
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | No tests for `/link`
| Fixed tickets |
| License       | MIT
| Doc PR        | can't find documentation for `/link`

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

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

Successfully merging a pull request may close this issue.

2 participants