-
-
Notifications
You must be signed in to change notification settings - Fork 933
Configuration filename to api_resources and allow single file declaration #568
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
Conversation
{ | ||
$paths = []; | ||
$globOptions = GLOB_BRACE | GLOB_NOSORT; | ||
$prefix = DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR; |
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.
What do you think about using the Symfony Finder Component instead of glob
directly?
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.
I can but I wanted to avoid adding a dependency only for this.
Le mar. 7 juin 2016 à 12:07, Kévin Dunglas notifications@github.com a
écrit :
In src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
#568 (comment):@@ -149,12 +149,16 @@ private function registerAnnotationLoaders(ContainerBuilder $container)
private function registerFileLoaders(ContainerBuilder $container)
{
$paths = [];
$globOptions = GLOB_BRACE | GLOB_NOSORT;
$prefix = DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR;
What do you think about using the Symfony Finder Component instead of glob
directly?—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/api-platform/core/pull/568/files/fd99357da41448ed77aceac668050c0b1b7d3ad8#r66043028,
or mute the thread
https://github.com/notifications/unsubscribe/ABQr81YXxO09RMmxY-MAwF1LJ_-k7Z6Dks5qJULFgaJpZM4Ivt1f
.
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.
Fair enough.
👍 ping @api-platform/core-team |
$paths = []; | ||
$globOptions = GLOB_BRACE | GLOB_NOSORT; | ||
$prefix = DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR; | ||
$apiResourcesGlob = $prefix.'api_resources.{xml,yml}'; |
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.
you should also allow .yaml
, it's not very common in Sf but a perfectly valid extension nonetheless.
I'll release an alpha 2 before the end of this week. It would have this PR merged. @soyuka wdyt about using the SF finder to make @theofidry happy? :) |
From what I understood he want me to move the "finder-like" code to a new class named "Finder" on api-platform. If implementing symfony's Btw sorry but I won't have time to add configurable properties until the end of this week (not so a BC break so it doesn't matter I hope)! |
@soyuka right, it's not a BC break so it's perfectly ok to add it later. Thanks for all your work. |
Just updated with Finder, let me know when to rebase, just keeping the old commit for now. btw +19 −19 sloc on the finder vs glob (but +1 dependency) 👯 I still use glob because it returns an empty array when nothing matches, avoids testing |
👍 |
Thank you for this good work on XML and YAML support @soyuka! |
@soyuka I do not think the |
@teohhanhui why? It's usual to have a root for config files like that isn't it? IIRC it's how its works for all Symfony config files. |
@dunglas For Symfony Validator and Serializer, when using individual config files the topmost key is the FQCN. |
ok! 👍 then |
Improve api file configuration resources, see #421 discussion
This changes the default filename for resources configuration from
resources.{yml,xml}
toapi_resources.{yml,xml,yaml}
. It also enables per-file configurations that would have to be located inResources/config/api_resources/*.{yml,xml,yaml}
.Note that I changed the fixture paths for my dummy resources to be less messy.