-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Fix XML/YAML config loading #575
Conversation
$configDirectory = dirname($reflectionClass->getFileName()).'/Resources/config/'; | ||
|
||
try { | ||
foreach (Finder::create()->files()->in($configDirectory)->path('api_resources')->name('*.{yml,yaml,xml}') as $file) { |
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.
api_resources.{yml,yaml,xml}
doesn't seem to be loaded anymore?
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.
Behat is requiring both to be loaded to pass if I remember correctly. If it's not the case, there's a missing test case.
see #576 too, take the want you prefer but anyway both implementations are correct ;) |
I prefer this implementation because it doesn't rely on |
Can you explain how it takes |
It doesn't work. A test should be added for that. |
My bad, the test (and my code) work fine. |
https://github.com/api-platform/core/blob/master/features/configurable.feature Both are there I checked so this can be merged ;). Fun that |
Thank for your help @soyuka |
Perhaps we should open an issue on symfony/symfony. It's not clear from the documentation... http://symfony.com/doc/current/components/finder.html#path |
For clarity, adds an example where `path()` is used to match a directory or a file. ref api-platform/core#575 (comment)
For clarity, adds an example where `path()` is used to match a directory or a file. ref api-platform/core#575 (comment)
For clarity, adds an example where `path()` is used to match a directory or a file. ref api-platform/core#575 (comment)
…oyuka) This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #6652). Discussion ---------- `Finder::path()` method matching directories and files For clarity, adds an example where `path()` is used to match a directory or a file. ref api-platform/core#575 (comment) Commits ------- cd28675 Improve `Finder::path` code example about resulting matches
Fix XML/YAML config loading
Fix an error when the
Resources/config
directory doesn't exist in the bundle ([InvalidArgumentException] The "/api-platform/src/AppBundle/Resources/config/" directory does not exist.
).Improve the code to load XML and YAML files.
ping @soyuka