landingi / event-store-bundle
Landingi 事件存储组件实现
v2.0.0
2024-01-26 11:53 UTC
Requires
- php: >=8.1
- ext-json: *
- doctrine/dbal: ^2.0|^3.0
- symfony/framework-bundle: 6.0.*
- symfony/http-client: 6.0.*
- symfony/uid: 6.0.*
Requires (Dev)
- landingi/php-coding-standards: ^1.0.0
- phpunit/phpunit: ^9.5
README
Landingi 事件存储实现
需求
- php >= 7.4
- Doctrine 2.0 || 3.0
- Symfony >= 5.2
配置
事件存储
在 service.yaml
中添加事件存储服务定义
landingi.event-store.dbal: class: Landingi\EventStoreBundle\EventStore\DbalEventStore arguments: ['@doctrine.dbal.default_connection'] Landingi\EventStoreBundle\EventStore: class: Landingi\EventStoreBundle\EventStore\ListenerEventStore arguments: ['@landingi.event-store.dbal'] calls: - [addListener, ['@your-event-listener-service']]
组件自动配置
- 在
config/packages
中添加landingi_event_store.yaml
,内容如下
landingi_event_store: event_store: connection: 'doctrine.dbal.default_connection' # landingi_production DB connection auditlog: enabled: true # set to false to disable AuditLogListener endpoint: 'http://audit-log' # base URL endpoint for SymfonyHttpAuditLogStore client: 'http_client' # instance of Symfony\Contracts\HttpClient\HttpClientInterface interface strict_mode: true # set to false to ignore StrictAuditLogListener allowed events list
- 在
config/bundles.php
中添加
Landingi\EventStoreBundle\LandingiEventStoreBundle::class => ['all' => true]