From 791bdc77c32858b8c208a117bf95b112495103e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Zaj=C4=85c?= Date: Wed, 18 Jan 2023 14:27:07 +0100 Subject: [PATCH] prooph event store recipes (#1479) event store interface should alias instance which wraps internal event store client wrapper gets registered by bundle package due it is the proper place to define an alias console command will be moved into the bundle --- .../config/packages/prooph_event_store.yaml | 11 ++++++++++ .../0.10/manifest.json | 9 +++++++++ .../packages/prooph_pdo_event_store.yaml | 20 +++++++++++++++++++ prooph/pdo-event-store/1.15/manifest.json | 13 ++++++++++++ prooph/pdo-event-store/1.15/post-install.txt | 4 ++++ 5 files changed, 57 insertions(+) create mode 100644 prooph/event-store-symfony-bundle/0.10/config/packages/prooph_event_store.yaml create mode 100644 prooph/event-store-symfony-bundle/0.10/manifest.json create mode 100644 prooph/pdo-event-store/1.15/config/packages/prooph_pdo_event_store.yaml create mode 100644 prooph/pdo-event-store/1.15/manifest.json create mode 100644 prooph/pdo-event-store/1.15/post-install.txt diff --git a/prooph/event-store-symfony-bundle/0.10/config/packages/prooph_event_store.yaml b/prooph/event-store-symfony-bundle/0.10/config/packages/prooph_event_store.yaml new file mode 100644 index 00000000..b4b3a9e1 --- /dev/null +++ b/prooph/event-store-symfony-bundle/0.10/config/packages/prooph_event_store.yaml @@ -0,0 +1,11 @@ +prooph_event_store: + stores: + default: + event_store: 'app.event_store.default' + +services: + _defaults: + public: false + + Prooph\EventStore\EventStore: '@prooph_event_store.default' + Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator: null diff --git a/prooph/event-store-symfony-bundle/0.10/manifest.json b/prooph/event-store-symfony-bundle/0.10/manifest.json new file mode 100644 index 00000000..9dc52b31 --- /dev/null +++ b/prooph/event-store-symfony-bundle/0.10/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "Prooph\\Bundle\\EventStore\\ProophEventStoreBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "src/": "%SRC_DIR%/" + } +} diff --git a/prooph/pdo-event-store/1.15/config/packages/prooph_pdo_event_store.yaml b/prooph/pdo-event-store/1.15/config/packages/prooph_pdo_event_store.yaml new file mode 100644 index 00000000..13ef79e4 --- /dev/null +++ b/prooph/pdo-event-store/1.15/config/packages/prooph_pdo_event_store.yaml @@ -0,0 +1,20 @@ +services: + _defaults: + public: false + + app.event_store.default: + class: Prooph\EventStore\Pdo\PostgresEventStore + arguments: + - '@prooph_event_store.message_factory' + - '@app.event_store.pdo_connection.postgres' + - '@app.event_store.postgres.persistence_strategy' + + app.event_store.pdo_connection.postgres: + class: \PDO + arguments: + - '%env(EVENT_STORE_DSN)%' + - '%env(EVENT_STORE_USER)%' + - '%env(EVENT_STORE_PASSWORD)%' + + app.event_store.postgres.persistence_strategy: + class: Prooph\EventStore\Pdo\PersistenceStrategy\PostgresSingleStreamStrategy diff --git a/prooph/pdo-event-store/1.15/manifest.json b/prooph/pdo-event-store/1.15/manifest.json new file mode 100644 index 00000000..3c2f89a9 --- /dev/null +++ b/prooph/pdo-event-store/1.15/manifest.json @@ -0,0 +1,13 @@ +{ + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "copy-from-package": { + "scripts/": "%CONFIG_DIR%/scripts/" + }, + "env": { + "EVENT_STORE_DSN": "pgsql:host=127.0.0.1;dbname=event_streams", + "EVENT_STORE_USER": "user", + "EVENT_STORE_PASSWORD": "password" + } +} diff --git a/prooph/pdo-event-store/1.15/post-install.txt b/prooph/pdo-event-store/1.15/post-install.txt new file mode 100644 index 00000000..034da956 --- /dev/null +++ b/prooph/pdo-event-store/1.15/post-install.txt @@ -0,0 +1,4 @@ + * Modify your EVENT_STORE_* configuration in .env + + * Create event streams and projections tables using SQL scripts + in %CONFIG_DIR%/scripts/*