Yaml files location
Today I had an argument with a senior developer from our team whether the yml files used in Alice should be into src/AcmeBundle/DataFixtures/ORM or src/AcmeBundle/Resources/fixtures.
The former was my proposal as I've seen this approach in some other projects. However, I lost the argument and this demo bundle was pointed to me as example to follow.
I think this is the wrong location to put the yml files, because there should be some level of separation. In general the Resources/ folder should be considered when putting non-php files into the project.
Can you give me some comments on that and move the yml files probably? Thanks.
Thanks for that request. This repo is for demonstration purposes, so i created a issue in the AliceFixtureBundle Repo and will be closing this issue then.
Probably you did not really got my request. It is in fact for the demonstration bundle.
Instead of doing:
$set->addFile(__DIR__.'/users.yml', 'yaml');
It could probably do:
$fileLocator = $container->get('file_locator');
$path = $fileLocator->locate('@MyBundle/Resources/fixtures/users.yml');
$set->addFile($path, 'yaml');
The sole purpose of this is to have a nice example with yml files being treated as resources.
Ah, i get it. As i can see from your example, a file_locator might be usefull in a FixtureSet, but that will need some DependencyInjection changes because currently there is no DI available for FixtureSets.
@dinamic Do you think it would good for FixtureSets to be ContainerAware or maybe we create something like FileLocatorAware?
It will be better to be aware only of the FileLocatorInterface.
Having the whole container on your disposal is never a good thing.