Skip to content

[Routing] Ignore hidden directories when loading routes from annotations #21832

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

Merged

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Mar 2, 2017

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21497
License MIT
Doc PR -

The problem surfaced after implementing #18869. Therefore it doesn't exist on 2.7, but I'd still merge it there to avoid conflicts when merging between branches. Without this fix, the oldest branch the added test will fail is 3.2.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Mar 2, 2017

I also think we should really skip them.
On the implementation side, would the FilesystemIterator::SKIP_DOTS flag work?
Note also that this would be consistent with how glob() and Finder work.

@jakzal
Copy link
Contributor Author

jakzal commented Mar 2, 2017

On the implementation side, would the FilesystemIterator::SKIP_DOTS flag work?

Skip dots only skips . and ...

Status: Needs Work

Doctrine bridge tests are failing now ;)

Edit: Doctrine bridge tests are failing for a different reason. Looking into it.

return '.' !== $current->getBasename()[0];
}
),
\RecursiveIteratorIterator::LEAVES_ONLY
Copy link
Member

Choose a reason for hiding this comment

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

you can still add FilesystemIterator::SKIP_DOTS
what about FilesystemIterator::FOLLOW_SYMLINKS also?

Copy link
Member

Choose a reason for hiding this comment

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

on the RecursiveDirectoryIterator of course

Copy link
Contributor Author

Choose a reason for hiding this comment

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

. and .. are already filtered out by '.' !== $current->getBasename()[0]; :)

Not sure about following symlinks. This is not a problem we're solving atm, so I wouldn't add it until someones comes up with a use case

@jakzal
Copy link
Contributor Author

jakzal commented Mar 2, 2017

Doctrine annotations problem should be fixed by #21825 and #21826

@jakzal jakzal force-pushed the fix-annotation-file-loader-with-hidden-files branch 5 times, most recently from ecca8a0 to d749406 Compare March 2, 2017 14:48
@jakzal jakzal force-pushed the fix-annotation-file-loader-with-hidden-files branch from d749406 to ce9df02 Compare March 2, 2017 14:51
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍
Status: reviewed

@fabpot
Copy link
Member

fabpot commented Mar 2, 2017

Thank you @jakzal.

@fabpot fabpot merged commit ce9df02 into symfony:2.7 Mar 2, 2017
fabpot added a commit that referenced this pull request Mar 2, 2017
…om annotations (jakzal)

This PR was merged into the 2.7 branch.

Discussion
----------

[Routing] Ignore hidden directories when loading routes from annotations

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21497
| License       | MIT
| Doc PR        | -

The problem surfaced after implementing #18869. Therefore it doesn't exist on 2.7, but I'd still merge it there to avoid conflicts when merging between branches. Without this fix, the oldest branch the added test will fail is 3.2.

Commits
-------

ce9df02 [Routing] Ignore hidden directories when loading routes from annotations
fabpot added a commit that referenced this pull request Mar 2, 2017
…colas-grekas)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Config] Sort "globbed" paths to make them predictable

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Spotted while reviewing #21832
ping @jakzal FYI

Note that glob already sorts its output, and Finder and glob skip dot dirs.

Commits
-------

ea1deff [Config] Sort "globbed" paths to make them predictable
@jakzal jakzal deleted the fix-annotation-file-loader-with-hidden-files branch March 2, 2017 16:07
This was referenced Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants