landingi/event-store-bundle

Landingi 事件存储组件实现

安装次数: 41,817

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

v2.0.0 2024-01-26 11:53 UTC

This package is auto-updated.

Last update: 2024-09-08 14:53:24 UTC


README

Landingi 事件存储实现

Build Status License MIT Packagist Version

需求

  • 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']]

组件自动配置

  1. 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
  1. config/bundles.php 中添加
Landingi\EventStoreBundle\LandingiEventStoreBundle::class => ['all' => true]