Skip to content

Commit 1c970fc

Browse files
author
Jeroen de Graaf
committed
Reorder documentation
1 parent 2ba68ec commit 1c970fc

File tree

1 file changed

+52
-64
lines changed

1 file changed

+52
-64
lines changed

README.md

Lines changed: 52 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,94 +4,82 @@
44

55
Gember Event Sourcing Symfony Bundle for ([gember/event-sourcing](https://github.com/GemberPHP/event-sourcing)).
66

7-
## Prerequisites
8-
This package requires Symfony `^7.1`.
7+
## Installation
8+
Install the Symfony Bundle with composer:
9+
10+
```bash
11+
composer require gember/event-sourcing-symfony-bundle
12+
```
913

10-
Several additional packages should be installed and configured in Symfony as well:
14+
This package requires Symfony `^7.1`.
1115

12-
#### Symfony Messenger (`symfony/messenger`)
13-
At least one message bus should be configured, with the name `@event.bus`.
16+
## Configuration
17+
This package installs _Gember Event Sourcing_ with all required dependency adapters.
18+
Some of these adapters need to be configured.
1419

15-
When this bus is configured, Gember Event Sourcing works out of the box.
16-
However, when a different event bus is preferred, it can be overwritten by configuration (`gember_event_sourcing.yaml`).
20+
By default, it uses the following configuration (`gember_event_sourcing.yaml`):
1721
```yaml
1822
gember_event_sourcing:
1923
message_bus:
2024
symfony:
2125
event_bus: '@event.bus'
22-
```
23-
Note: It must be a service implementing `Symfony\Component\Messenger\MessageBusInterface`.
24-
25-
#### Symfony Cache (`symfony/cache`)
26-
Gember Event Sourcing makes use of `@cache.app`.
27-
This cache service is automatically configured when using Symfony framework including `symfony/cache`.
28-
29-
When this cache service is configured, Gember Event Sourcing works out of the box.
30-
However, when a different cache pool is preferred, it can be overwritten by configuration (`gember_event_sourcing.yaml`):
31-
```yaml
32-
gember_event_sourcing:
3326
cache:
3427
enabled: true
3528
psr6: '@cache.app'
36-
29+
3730
# Or set a PSR-16 compatible cache layer of your choice
3831
# psr16: '@some.psr16.service'
39-
```
40-
Note: It must be a service implementing `Psr\Cache\CacheItemPoolInterface` (PSR-6) or `Psr\SimpleCache\CacheInterface` (PSR-16).
41-
42-
#### Symfony Serializer (`symfony/serializer`)
43-
Gember Event Sourcing makes use of `@serializer`.
44-
This serializer service is automatically configured when using Symfony framework including `symfony/serializer`.
45-
46-
When this serializer service is configured, Gember Event Sourcing works out of the box.
47-
However, when a different serializer is preferred, it can be overwritten by configuration (`gember_event_sourcing.yaml`):
48-
```yaml
49-
gember_event_sourcing:
5032
serializer:
5133
symfony:
52-
serializer: '@serializer'
34+
serializer: '@serializer'
35+
event_store:
36+
rdbms:
37+
doctrine_dbal:
38+
connection: '@doctrine.dbal.default_connection'
39+
generator:
40+
identity:
41+
# Use Gember alias of @Symfony\Component\Uid\Factory\UuidFactory:
42+
service: '@gember.identity_generator_symfony.uuid.symfony_uuid_identity_generator'
43+
44+
# Or use Gember alias of @Symfony\Component\Uid\Factory\UlidFactory:
45+
# service: '@gember.identity_generator_symfony.ulid.symfony_ulid_identity_generator'
46+
registry:
47+
event_registry:
48+
reflector:
49+
path: '%kernel.project_dir%/src'
5350
```
54-
Note: It must be a service implementing `Symfony\Component\Serializer\SerializerInterface`.
5551
56-
#### Doctrine DBAL/ORM (`doctrine/dbal`, `doctrine/orm`)
57-
Gember Event Sourcing makes use of `@doctrine.dbal.default_connection`.
58-
This connection service is automatically configured when using Symfony framework including `doctrine/dbal` or `doctrine/orm`.
52+
You can override any of these defaults however you like.
5953
60-
When this connection service is configured, Gember Event Sourcing works out of the box.
61-
However, when a different Doctrine connection is preferred, it can be overwritten by configuration (`gember_event_sourcing.yaml`):
62-
```yaml
63-
gember_event_sourcing:
64-
event_store:
65-
rdbms:
66-
doctrine_dbal:
67-
connection: '@doctrine.dbal.default_connection'
68-
```
69-
Note: It must be a service implementing `Doctrine\DBAL\Connection`.
54+
## Required dependencies
55+
Some of the required dependencies also need to be configured separately.
7056
71-
#### Symfony UID (`symfony/uid`)
72-
Gember Event Sourcing makes use of `@Symfony\Component\Uid\Factory\UuidFactory` or `Symfony\Component\Uid\Factory\UlidFactory`.
57+
### Symfony Messenger (`symfony/messenger`)
58+
At least one message bus should be configured, with the name `@event.bus`.
7359

74-
These factories are automatically configured when using Symfony framework including `symfony/uid`.
60+
When this bus is configured, _Gember Event Sourcing_ works out of the box.
61+
However, when a different event bus is preferred, it must be a service implementing `Symfony\Component\Messenger\MessageBusInterface`.
7562

76-
By default, the UUID factory is used in Gember Event Sourcing.
77-
However, if the ULID factory is preferred, it can be overwritten by configuration (`gember_event_sourcing.yaml`):
78-
```yaml
79-
gember_event_sourcing:
80-
generator:
81-
identity:
82-
# Use Gember alias of @Symfony\Component\Uid\Factory\UuidFactory:
83-
service: '@gember.identity_generator_symfony.uuid.symfony_uuid_identity_generator'
63+
### Symfony Cache (`symfony/cache`)
64+
_Gember Event Sourcing_ makes use of `@cache.app`.
65+
This cache service is automatically configured when using Symfony framework including `symfony/cache`.
8466

85-
# Or use Gember alias of @Symfony\Component\Uid\Factory\UlidFactory:
86-
# service: '@gember.identity_generator_symfony.ulid.symfony_ulid_identity_generator'
87-
```
67+
When this cache service is configured, _Gember Event Sourcing_ works out of the box.
68+
However, when a different cache pool is preferred, it must be a service implementing `Psr\Cache\CacheItemPoolInterface` (PSR-6) or `Psr\SimpleCache\CacheInterface` (PSR-16).
8869

89-
## Installation
90-
When all prerequisites are met, it's time to install the bundle package itself:
70+
### Symfony Serializer (`symfony/serializer`)
71+
_Gember Event Sourcing_ makes use of `@serializer`.
72+
This serializer service is automatically configured when using Symfony framework including `symfony/serializer`.
9173

92-
```bash
93-
composer require gember/event-sourcing-symfony-bundle
94-
```
74+
When this serializer service is configured, _Gember Event Sourcing_ works out of the box.
75+
However, when a different serializer is preferred, it must be a service implementing `Symfony\Component\Serializer\SerializerInterface`.
76+
77+
### Doctrine DBAL/ORM (`doctrine/dbal`, `doctrine/orm`)
78+
_Gember Event Sourcing_ makes use of `@doctrine.dbal.default_connection`.
79+
This connection service is automatically configured when using Symfony framework including `doctrine/dbal` or `doctrine/orm`.
80+
81+
When this connection service is configured, _Gember Event Sourcing_ works out of the box.
82+
However, when a different Doctrine connection is preferred, it must be a service implementing `Doctrine\DBAL\Connection`.
9583

9684
## Database
9785
In order to persist all domain events in database, a running SQL database is needed.

0 commit comments

Comments
 (0)