Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ticket 4911 - Fixed ignoreDotFiles(true) which did not exclude folders properly #4932

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

Closed
wants to merge 1 commit into from

Conversation

nathanlon
Copy link

[Finder] Issue #4911 - Fixed ignoreDotFiles(true) which did not exclude folders properly

Found that ExcludeDirectoryFilterIterator.php would not take .*, but only specific folder full names, so added $extraPatterns and extended tests to look at a /.foo/bar (was missed as the .bar in /.foo/.bar was hiding the excluding the folder with the correctly excluded file.

Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: Build Status
Fixes the following tickets: #4911
License of the code: MIT

{
$this->patterns = array();
foreach ($directories as $directory) {
$this->patterns[] = '#(^|/)'.preg_quote($directory, '#').'(/|$)#';
}

if (!is_null($extraPatterns)) {
Copy link
Member

Choose a reason for hiding this comment

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

this should be null !==. And it would probably be even better to make the argument default to an empty array and remove this check entirely

@stof
Copy link
Member

stof commented Jul 15, 2012

@nathanlon FYI, the email address used by your git commits does not seem to be associated to your github account. So these commits will not be linked to you in the contributors page of the symfony.com website until you fix it.

Ticket 4911 - Found that ExcludeDirectoryFilterIterator.php would not take .*, but only specific folder full names, so added $extraPatterns and extended tests to look at a /.foo/bar (was missed as the .bar in /.foo/.bar was hiding the excluding the folder with the correctly excluded file.
@nathanlon
Copy link
Author

Thanks @stof , I have removed the is_null check and made the default an array as suggested. I've also edited the committer to align with my github account. I can't get in to sensiolabs connect today though as password resets don't work.

@fabpot
Copy link
Member

fabpot commented Jul 18, 2012

I don't like the implementation as it feels like a hack. #4739 is probably a better option to fix the issue.

{
$this->patterns = array();
foreach ($directories as $directory) {
$this->patterns[] = '#(^|/)'.preg_quote($directory, '#').'(/|$)#';
}

foreach ($extraPatterns as $pattern) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you could use array_merge here. extraPatterns could also be patterns. Otherwise this PR looks good to me.

@stof
Copy link
Member

stof commented Oct 13, 2012

@fabpot should this PR be merged as is or should it wait for #4739 and then be refactored using the new feature ?

@gajdaw gajdaw mentioned this pull request Oct 13, 2012
@fabpot
Copy link
Member

fabpot commented Oct 30, 2012

Closing this PR in favor of #5128

@fabpot fabpot closed this Oct 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants