PHP EventStore Implementation
PHP 5.5+ EventStore Implementation.
ProophEventStore is capable of persisting event objects that are organized in streams. The EventStore itself is a facade for different persistence adapters (check the list below) and adds event-driven hook points for features. Features can provide additional functionality like publishing persisted events on an event bus or validate events before they are stored. ProophEventStore ships with different strategies to organize event streams and a base repository implementation for event sourced aggregate roots. Each aggregate repository can work with another stream strategy to offer you maximum flexibility.
You can install ProophEventStore via composer by adding
"prooph/event-store": "~3.0" as requirement to your composer.json.
- SingleStreamStrategy: Stores the events of all aggregates in one single stream
- AggregateStreamStrategy: Creates a stream for each aggregate instance
- AggregateTypeStreamStrategy: Stores the events of all aggregates of the same type (f.e. all Users) in one stream
** Note ** Check the usage example to see how you can set up a repository with a stream strategy.
ProophEventStore wants to get out of your way as much as it can. To achieve this goal it requires neither a specific aggregate implementation nor a domain event implementation. Instead it uses translation adapters which are responsible for translating custom domain events to Prooph\Common\Messaging\DomainEvent and to reconstitute an aggregate from it's event history. You are asked to provide an AggregateTranslator for your aggregates or you use ProophEventSourcing which has build in support for prooph/event-store.
** Note ** Check the usage example to see how you can set up a repository with an AggregateTranslator.
Check the example of ProophEventSourcing to see the EventStore in action.
prooph/proophessor seamlessly integrates ProophEventStore with a ZF2 application.
- Ask questions on prooph-users google group.
- File issues at https://github.com/prooph/event-store/issues.
Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.
- The ProophEventStore is based on ZF2 components which offer a lot of customization options.
- Uuids of the StreamEvents are generated with rhumsaa/uuid
- Assertions are performed by beberlei/assert