rad-fixtures-load icon indicating copy to clipboard operation
rad-fixtures-load copied to clipboard

Fixtures path

Open theofidry opened this issue 9 years ago • 2 comments

As of now Alice fixtures must be placed under Resources/fixtures/orm.

Wouldn't it better to keep the DoctrineFixtures behavior which allows to specify the path where the loader is declared and with a default file path? And wouldn't it be better to keep the default path and make it configurable?

That would have the benefits to:

  • ease the transition if previously using another bundle to do this kind of task
  • keep the same convention while allowing one to define it's own convention and keeping the interesting feature you introduced which is loading fixtures for a given bundle
  • being more generic and not too much Symfony specific

Besides for the filtering you're using a file extension convention system with .yml, .dev.yml, .prod.yml and so on. This is fine if you don't have too much files. If you have even just 10 files for each, it's much more practical to use separate folders. To retake the example of what you can currently achieve with hautelook/AliceBundle, you can have:

DataFixtures
├── Prod
|   ├── DataLoader.php
|   ├── ...
|   └── fixtures.yml
├── Inte
|   ├── DataLoader.php
|   ├── ...
|   └── fixtures.yml
└── Dev
    ├── DataLoader.php
    ├── ...
    └── fixtures.yml

And keep things clear.

theofidry avatar Jul 10 '15 11:07 theofidry

@theofidry Thanks for your feedback. I totally agree with you, maybe the filter system can be more usefull if you can provide a pattern (ex: *.dev.yml ou Prod/*.yml). And your idea to add a parameter to define the fixtures folder is good, but you have to keep the same convention between all bundles inside the same project...

PedroTroller avatar Oct 28 '15 11:10 PedroTroller

I also like the idea of subdirectories. :+1:

Einenlum avatar Nov 01 '15 18:11 Einenlum