snapshotpl/tactician-doctrine
Composer 安装命令:
composer require snapshotpl/tactician-doctrine
包简介
Plugins for Tactician commands using Doctrine, like wrapping every command in a transaction
README 文档
README
This package adds plugins for using Tactician with Doctrine components, either the ORM or just DBAL. The main feature is the ability to wrap each command in a separate database transaction.
Setup
Via Composer
$ composer require league/tactician-doctrine
Next, add the ORM\TransactionMiddleware to your CommandBus:
$commandBus = new \League\Tactician\CommandBus( [ new TransactionMiddleware($ormEntityManager) ] );
That's it. Each command you execute will now open and close a new transaction.
If a command fires off more commands, be aware that those commands will run in the same transaction as the parent. It is recommended that you run each command as a separate transaction, so to prevent this from happening, use the LockingMiddleware that ships in Tactician core. This will queue the commands up internally until the parent command has completed.
If an exception is raised while handling the command, the transaction is rolled back, the EntityManager closed, and the exception rethrown.
Symfony integration
When using the [tactician-bundle] (https://github.com/thephpleague/tactician-bundle), don't forget to add the Doctrine middleware to your Symfony config:
tactician:
commandbus:
default:
middleware:
- tactician.middleware.locking
- tactician.middleware.doctrine
- tactician.middleware.command_handler
Testing
$ ./vendor/bin/phpunit
Security
Disclosure information can be found on the main Tactician repo.
License
The MIT License (MIT). Please see License File for more information.
snapshotpl/tactician-doctrine 适用场景与选型建议
snapshotpl/tactician-doctrine 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 663 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 01 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「doctrine」 「transactions」 「command bus」 「tactician」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 snapshotpl/tactician-doctrine 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 snapshotpl/tactician-doctrine 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 snapshotpl/tactician-doctrine 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Wrapper for exec and it's results
Symfony bundle to monitor and execute commands
Shell command module for PHP.
Library with classes to help you do batch.
A Laravel package to easily integrate Xendit payment gateway. It supports credit and debit cards, and e-wallet payments and custom invoices, queued notifications, webhook listeners and more.
Command bus implementation: Commands and domain events
统计信息
- 总下载量: 663
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-11