定制 knplabs/rad-fixtures-load 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

knplabs/rad-fixtures-load

最新稳定版本:1.6.1

Composer 安装命令:

composer require knplabs/rad-fixtures-load

包简介

A command to load them all

README 文档

README

Unfortunately we decided to not maintain this project anymore (see why). If you want to mark another package as a replacement for this one please send an email to hello@knplabs.com.

Rapid Application Development : Fixtures Load

A command to load them all

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

This library uses the awesome nelmio/alice library.

Official maintainers:

Installation

composer require --dev knplabs/rad-fixtures-load:~1.0
class AppKernel
{
    function registerBundles()
    {
        $bundles = array(
            //...
            new Knp\Rad\FixturesLoad\Bundle\FixturesLoadBundle(),
            //...
        );

        //...

        return $bundles;
    }
}

Usages

Inside your bundle, you have to store your Alice fixtures files into Resources/fixtures/orm.

Load fixtures of all bundles

Just run the command

app/console rad:fixtures:load

Or if you need both resetting your schema, just add -r option

app/console rad:fixtures:load -r

Load fixtures of specific bundles

I've got two bundles, App and Api.

app/console rad:fixtures:load -b App -b Api

The order is important. Fixtures will be loaded following this order.

Use file filtering

If I run this command

app/console rad:fixtures:load -f dev

All files finishing with .dev.yml will be loaded. And just those files.

You can also chain filters.

app/console rad:fixtures:load -f dev -f test

In this case, order doesn't have any importance.

Use Alice provider or Alice processor

You just have to tag your service with knp_rad_fixtures_load.provider or 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 }

统计信息

  • 总下载量: 80.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 26
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 26
  • Watchers: 28
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-18