-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] fix perf of glob discovery when GLOB_BRACE is not available #35015
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
d64b2a0
to
0526524
Compare
0526524
to
b50c36a
Compare
I think we need more tests covering the fallback usage, especially given we don't run our testsuite on Alpine |
@stof can you please hint me about which kind of tests are missing to you? |
Well, exercising it with a bunch of different globs, including cases which are unsupported by the fallback, to be sure they get properly detected as needing Finder rather than trying to be handled by the fallback implementation. I was hoping that we could get inspiration from the test cases of the zend-stdlib implementation, but they seem to test only 1 case in their provider. |
b50c36a
to
019a251
Compare
I've made the fallback support nested braces instead :) |
019a251
to
8aad0e7
Compare
you still don't have tests which include nested braces actually needing expansion. and you are also missing tests covering what happens when feeding it with invalid braces for the glob. |
Here you are. |
8aad0e7
to
8af6d86
Compare
$p->setAccessible(true); | ||
$p->setValue($resource, 0); | ||
|
||
$this->assertSame([], array_keys(iterator_to_array($resource))); |
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.
is this actually what happens with glob
, or does it report an error ?
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.
no error, just no matches
… available (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Config] fix perf of glob discovery when GLOB_BRACE is not available | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #35009 | License | MIT | Doc PR | - This PR implements a fast fallback implementation of GLOB_BRACE for musl-based libc, as found on Alpine. It is *not* a feature-complete fallback implementation. Implementing one would be [much more involving](https://github.com/zendframework/zend-stdlib/blob/master/src/Glob.php). But the provided implementation is good enough in practice IMHO, and the slow path is still used when not-covered glob patterns are used. Here is the comparison:   Commits ------- 8af6d86 [Config] improve perf of glob discovery when GLOB_BRACE is not available
This PR implements a fast fallback implementation of GLOB_BRACE for musl-based libc, as found on Alpine. It is not a feature-complete fallback implementation. Implementing one would be much more involving. But the provided implementation is good enough in practice IMHO, and the slow path is still used when not-covered glob patterns are used.
Here is the comparison:
