Skip to content

[HttpKernel] Add glob support for bundle resource locator #22350

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

pierredup
Copy link
Contributor

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

This is a continuation of #21270 and #21635 to add glob support when locating bundle resources.
So the following becomes possible:

@SomeBundle/{Action,Controller}
@SomeBunde/Resources/config/*.yml

@fabpot
Copy link
Member

fabpot commented Apr 10, 2017

I don't understand the use case as it always returns the first matching resource.

@pierredup
Copy link
Contributor Author

The default behaviour is to return the first match , but if you pass the third parameter to locateResource as false, then it returns an array of matching resources

@nicolas-grekas
Copy link
Member

Closing as there is no activity, and I'm not sure this works in practice, as the glob will miss overridden resources. Feel free to reopen of course.

@pierredup
Copy link
Contributor Author

Would the overridden resource not already be resolved at this point?

@stof
Copy link
Member

stof commented Oct 10, 2017

nope. The bundle inheritance is gone, but this locator still allows project-level overriding.

@pierredup
Copy link
Contributor Author

But by the time it does the file_exists check, should it not aleady have resolved the overridden resource, to know which file and path to check?

@stof
Copy link
Member

stof commented Oct 10, 2017

but for a glob, each one of the match could be overridden independently (and this PR won't handle it).

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.

5 participants