承接 riverline/predaddy-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

riverline/predaddy-bundle

最新稳定版本:2.0.0

Composer 安装命令:

composer require riverline/predaddy-bundle

包简介

Integrate predaddy DDD/CQRS lib into a Symfony2 application

README 文档

README

What is Riverline\PredaddyBundle

`Riverline\PredaddyBundle` help to integrate predaddy components into a Symfony2 application.

Requirements

  • PHP 7.x
  • Symfony 2.x

Installation

`Riverline\PredaddyBundle` is compatible with composer and any psr-4 autoloader

Configuration

riverline_predaddy:
    command_bus:
        app_command_bus_1:                                    # Specify multiple command bus names
            transaction_manager: predaddy.transaction_manager # Transaction manager service id

    event_bus:
        app_event_bus_1:                                      # Specify multiple event bus names
            transaction_manager: predaddy.transaction_manager # Transaction manager service id
        app_event_bus_2:                                      # Specify multiple event bus names
            transaction_manager: predaddy.transaction_manager # Transaction manager service id
            
    transaction_manager:
        class: trf4php\doctrine\DoctrineTransactionManager # (default value)
        entity_manager: doctrine.orm.entity_manager        # Doctrine entity manager service id (default value)
        
    annotation_reader: annotation_reader                   # (default value)

You can use command_bus in your services with following services ids :

$this->getContainer()->get("riverline.predaddy_bundle.command_bus.app_command_bus_1")    

And for event buses :

$this->getContainer()->get("riverline.predaddy_bundle.command_bus.app_command_bus_1")    

Logging

`Riverline\PredaddyBundle` add Symfony2 'logger' service as root logger (supports only Monolog logger).

Usage

Define command and event handler as container service, and add tag to register to buses.

services:

  ## EVENT HANDLERS
    my.cqrs.event_handler.something:
      class: My\Vendor\SomethingEventHandler
      tags:
        -  { name: predaddy.event_handler, channel: command_bus_1 } # Channel is optionnel only if you have only once command bus

  ## COMMAND HANDLERS
    my.cqrs.command_handler.something:
      class: My\Vendor\SomethingEventHandler
      tags:
        -  { name: predaddy.command_handler, channel: event_bus_2 } # Channel is optionnel only if you have only once event bus

Tests

$ ./vendor/bin/phpunit

Limitations / Known issues

  • Works only with Predaddy 1.2
  • Supports only Monolog logger
  • And probably other ...

License

See Resources/meta/LICENSE

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-13