knplabs / rad-fixtures-load
此包已被废弃,不再维护。没有建议的替代包。
加载所有包的命令
1.6.1
2017-09-21 08:22 UTC
Requires
- php: ~7.0
- doctrine/common: ~2.0
- doctrine/orm: ~2.0
- nelmio/alice: ~1.5||~2.0
- symfony/dependency-injection: ~2.3|~3.0
- symfony/finder: ~2.3|~3.0
- symfony/framework-bundle: ~2.3|~3.0
- symfony/http-kernel: ~2.3|~3.0
Requires (Dev)
- pedrotroller/php-cs-custom-fixer: ~1.2.1
- phpspec/phpspec: ~2.1
This package is auto-updated.
Last update: 2022-09-23 13:36:35 UTC
README
不幸的是,我们决定不再维护此项目 anymore (查看原因)。如果您想将另一个包标记为替代包,请发送电子邮件至 hello@knplabs.com。
快速应用开发:Fixtures Load
加载所有包的命令
此库使用了优秀的 nelmio/alice 库。
官方维护者
安装
composer require --dev knplabs/rad-fixtures-load:~1.0
class AppKernel { function registerBundles() { $bundles = array( //... new Knp\Rad\FixturesLoad\Bundle\FixturesLoadBundle(), //... ); //... return $bundles; } }
用法
在您的bundle中,您需要将Alice fixtures文件存储到Resources/fixtures/orm
。
加载所有bundle的Fixtures
只需运行以下命令
app/console rad:fixtures:load
如果您需要重置模式,请添加-r选项
app/console rad:fixtures:load -r
加载特定bundle的Fixtures
我有两个bundle,App
和 Api
。
app/console rad:fixtures:load -b App -b Api
顺序很重要。将按照此顺序加载Fixtures。
使用文件过滤
如果运行此命令
app/console rad:fixtures:load -f dev
所有以.dev.yml
结尾的文件都将被加载。只加载这些文件。
您也可以链式过滤。
app/console rad:fixtures:load -f dev -f test
在这种情况下,顺序没有关系。
使用Alice提供者或Alice处理器
您只需将服务标记为knp_rad_fixtures_load.provider
或knp_rad_fixtures_load.processor
。
my_bundle.my_provider: class: My\Provider tags: - { name: knp_rad_fixtures_load.provider } my_bundle.my_processor: class: My\Processor # implements Nelmio\Alice\ProcessorInterface tags: - { name: knp_rad_fixtures_load.processor }