-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Finder] Add early directory prunning filter support #50877
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
[Finder] Add early directory prunning filter support #50877
Conversation
0117bc0
to
2cb6ad5
Compare
2cb6ad5
to
c47a9b8
Compare
74945e2
to
b5dd592
Compare
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.
Can you expand a bit on the PR description to say what pruning is about in the context of the Finder component? It would help ppl get what this is about more quickly I think.
src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
Outdated
Show resolved
Hide resolved
2cdcbf7
to
4864bea
Compare
4864bea
to
6cdfe93
Compare
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.
LGTM, please just use a regular @param
annotation for the added argument.
45d034d
to
baca842
Compare
@mvorisek Can you rebase to resolve the conflicts? |
baca842
to
840cb28
Compare
Thank you @mvorisek. |
…er support (mvorisek) This PR was merged into the 6.4 branch. Discussion ---------- [Finder] [Finder docs] Add early directory prunning filter support Refs * symfony/symfony#50877 Commits ------- 4b08ee6 [Finder docs] Add early directory prunning filter support
Filtering terminology first:
Currently there is early directory prunning support possible, but with string patterns only, not even full regex is supported as the input is always quoted - https://github.com/symfony/symfony/blob/v6.2.12/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php#L45.
This PR adds early directory prunning with full callback support.
Tested with VFS to assert the pruned directories are really not traversed and the count of IO syscalls is minimal.