malocher/zf2-cqrs-module
Composer 安装命令:
composer require malocher/zf2-cqrs-module
包简介
PHP CQRS + Service Bus integration for Zend Framework 2
关键字:
README 文档
README
Zend Framework 2 Module that integrates the Malocher CQRS + Service Bus
Installation
Installation of MalocherCqrsModule uses composer. For composer documentation, please refer to getcomposer.org. Add following requirement to your composer.json
"malocher/zf2-cqrs-module" : "1.*"
Then add MalocherCqrsModule to your `config/application.config.php``
Installation without composer is not officially supported, and requires you to install and autoload
the dependencies specified in the composer.json.
Setup
Setup the CQRS System using your module or application configuration. Put all CQRS options under the key cqrs.
'cqrs' => array( 'adapters' => array( 'Malocher\Cqrs\Adapter\ArrayMapAdapter' => array( 'buses' => array( 'My\Bus\DomainBus' => array( 'My\Command\AddEntityCommand' => array( 'alias' => 'my_add_entity_command_handler', 'method' => 'addEntity' ), ), ), ), ), ), 'service_manager' => array( 'invokables' => array( 'my_add_entity_command_handler' => 'My\Repository\EntityRepository', ), ),
The ZF2 ServiceManager acts as Handler- and EventListenerLoader. That means, you can use your ServiceManager aliases to pipe your commands, queries and events to your repositories, services and whatever you use in your application.
##Usage
You can request the Malocher CQRS Gate from the ServiceManager. The hole setup of the CQRS and Service Bus System is done in the background. Here is a simple example that invokes the AddEntityCommand on the DomainBus from within a controller:
<?php namespace My\Controller; use Zend\Mvc\Controller\AbstractActionController; use My\Command\AddEntityCommand; use My\Bus\DomainBus; class MyController extends AbstractActionController { public function addEntityAction() { $entityName = $this->getEvent()->getRouteMatch()->getParam('entityname'); $addEntityCommand = new AddEntityCommand(); $addEntityCommand->setName($entityName); $this->getServiceLocator() ->get('malocher.cqrs.gate') ->getBus(DomainBus::NAME) ->invokeCommand($addEntityCommand); } }
Sample Application
You can find a sample application with annotated sourcecode on malocher/zf2-cqrs-sample
malocher/zf2-cqrs-module 适用场景与选型建议
malocher/zf2-cqrs-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 128 次下载、GitHub Stars 达 7, 最近一次更新时间为 2013 年 12 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「zf2」 「cqrs」 「esb」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 malocher/zf2-cqrs-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 malocher/zf2-cqrs-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 malocher/zf2-cqrs-module 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
LosLog provides some log utility
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Interfaces, Traits and Nominal Classes used by Domain Entities Implementing Domain Events
Implementation of the transactional outbox pattern on top of rekalogika/domain-event
Zend Framework module to leverage the symfony dependency injection container
统计信息
- 总下载量: 128
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 10
- 依赖项目数: 5
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2013-12-04