Skip to content
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

GLOB_BRACE not defined on some OS #1291

Closed
aaron50x opened this issue Jul 9, 2016 · 5 comments
Closed

GLOB_BRACE not defined on some OS #1291

aaron50x opened this issue Jul 9, 2016 · 5 comments
Labels
Milestone

Comments

@aaron50x
Copy link

aaron50x commented Jul 9, 2016

I installed php 5.6, with composer and mongodb driver, then I created the quickstart project and started php built-in web server, then go to http://localhost:8080, this notice came up:

Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /home/li3/app/manager-ui/libraries/lithium/core/Libraries.php on line 998

Notice: Use of undefined constant GLOB_BRACE - assumed 'GLOB_BRACE' in /home/li3/app/manager-ui/libraries/lithium/core/Libraries.php on line 999

I fixed it by adding this just right before line 996:

        if(!defined('GLOB_BRACE')) {
            define('GLOB_BRACE', 0x10);
        }

I'd like to know if it's a valid fix, if I can make the pull request with this fix :)

Below the screenshot:

li3-app-error

aaron50x added a commit to aaron50x/lithium that referenced this issue Jul 9, 2016
@mariuswilms
Copy link
Member

mariuswilms commented Jul 10, 2016

Yes, there are OSs that don't define GLOB_BRACE (http://php.net/manual/en/function.glob.php). However, the documentation is a bit unclear in this regard. It states non-GNU-OSs but BSD has support for it (https://www.freebsd.org/cgi/man.cgi?query=glob&sektion=3).

What kind of OS are you running?

I don't want to sacrifice this feature when we don't have to (the problem can be fixed outside the framework).

Why are you defining GLOB_BRACE with 0x10? Where does that value come from?

@mariuswilms
Copy link
Member

Refs 1636fa0

@mariuswilms mariuswilms added this to the 1.0 milestone Jul 10, 2016
mariuswilms added a commit that referenced this issue Jul 10, 2016
GLOB_BRACE is not available on all platforms:
http://php.net/glob

Fixes #1291
Supersedes #1292
@mariuswilms
Copy link
Member

mariuswilms commented Jul 10, 2016

I've decided to deprecate this feature. Independent of the OS you are using, it seems this feature cannot be used reliably. Thanks for the bug report and PR, which I could not use, as we needed the deprecation.

With the deprecation we conditionally use brace globbing. So you should see the error message go away, granted nothing is using brace globbing.

@mariuswilms
Copy link
Member

Next time let's talk about what could be the best fix first, so I can help you create a PR that gets merged.

@aaron50x
Copy link
Author

Sure i had this working, with the PR, for sure not the most portable solution, so it's good that you already have a fix. Thanks :)

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

No branches or pull requests

2 participants