定制 maxkaemmerer/messaging-symfony-bridge 二次开发

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

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

maxkaemmerer/messaging-symfony-bridge

Composer 安装命令:

composer require maxkaemmerer/messaging-symfony-bridge

包简介

This is a bridge providing DI for maxkaemmerer/events and maxkaemmerer/command in symfony.

README 文档

README

This is a bridge providing DI for maxkaemmerer/events and maxkaemmerer/command in symfony.

Just register the needed compiler passes in your symfony Kernel as seen below.

CommandBus and EventCourier are automatically registered as services.

Every symfony service implementing CommandHandler or EventSubscriber get automatically registered in the EventCourier or CommandBus.

So the only thing you need to do is start dispatching commands and events implementing the corresponding interfaces Command and Event, as seen in the documentation of maxkaemmerer/events and maxkaemmerer/commands. ;)

Symfony Kernel:

use MaxKaemmerer\MessagingSymfonyBridge\CompilerPass\CommandBusPass;
use MaxKaemmerer\MessagingSymfonyBridge\CompilerPass\EventCourierPass;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;

class Kernel extends BaseKernel
{

    // ...
    
    protected function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new CommandBusPass());
        $container->addCompilerPass(new EventCourierPass());
        parent::build($container);
    }
    
    // ...
    
 }

More detailed examples might follow.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固