phpgears/cqrs-tactician 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

phpgears/cqrs-tactician

Composer 安装命令:

composer require phpgears/cqrs-tactician

包简介

CQRS implementation with League Tactician

README 文档

README

PHP version Latest Version License

Build Status Style Check Code Quality Code Coverage

Total Downloads Monthly Downloads

CQRS with Tactician

CQRS implementation with League Tactician

Installation

Composer

composer require phpgears/cqrs-tactician

Usage

Require composer autoload file

require './vendor/autoload.php';

Commands Bus

use Gears\CQRS\Tactician\CommandBus;
use Gears\CQRS\Tactician\CommandHandlerMiddleware;
use League\Tactician\CommandBus as TacticianBus;
use League\Tactician\Handler\Locator\InMemoryLocator;
use League\Tactician\Plugins\LockingMiddleware;

$commandToHandlerMap = [];
        
$tacticianBus = new TacticianBus([
    new LockingMiddleware(),
    new CommandHandlerMiddleware(new InMemoryLocator($commandToHandlerMap)),
]);

$commandBus = new CommandBus($tacticianBus);

/** @var \Gears\CQRS\Command $command */
$commandBus->handle($command);

Query Bus

use Gears\CQRS\Tactician\QueryBus;
use Gears\CQRS\Tactician\QueryHandlerMiddleware;
use League\Tactician\CommandBus as TacticianBus;
use League\Tactician\Handler\Locator\InMemoryLocator;
use League\Tactician\Plugins\LockingMiddleware;

$queryToHandlerMap = [];
        
$tacticianBus = new TacticianBus([
    new LockingMiddleware(),
    new QueryHandlerMiddleware(new InMemoryLocator($queryToHandlerMap)),
]);

$queryBus = new QueryBus($tacticianBus);

/** @var \Gears\CQRS\Query $query */
$result = $queryBus->handle($query);

Contributing

Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.

See file CONTRIBUTING.md

License

See file LICENSE included with the source code for a copy of the license terms.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固