busfactor / busfactor
CQRS and Event Sourcing infrastructure for modern PHP
Installs: 5 597
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^7.3 || ^8.0
- ext-json: *
- ext-pdo: *
- ramsey/uuid: ^3.0 || ^4.0
Requires (Dev)
- ext-pdo_sqlite: *
- friendsofphp/php-cs-fixer: ^3
- illuminate/cache: ^8
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^9
- squizlabs/php_codesniffer: ^3
README
BusFactor is a modern PHP library providing several components you can mix and match to implement the CQRS and Event Sourcing patterns in your application.
Install
Using Composer:
$ composer require busfactor/busfactor
Requirements
- PHP >=7.3 with
json
andpdo
extensions enabled.
Components
Component | Description |
---|---|
Aggregate |
Interfaces and traits for plain DDD aggregates and domain events. |
AggregateStore |
Persistence for aggregates. |
CacheProjectionStoreMiddleware |
Caching middleware for ProjectionStore . |
CommandBus |
Implementation of the Command Bus pattern. |
EventBus |
Implementation of the Publish-Subscribe pattern for event streams. |
EventSourcedAggregate |
Interface and trait for event-sourced aggregates. |
EventSourcedAggregateStore |
AggregateStore adapter for event-sourced aggregates persistence. |
EventStore |
Persistence for event streams. |
EventStoreReductionInspection |
Output single value from EventStore inspection. |
EventStream |
Event streams for event-sourced aggregates. |
LaravelCacheProjectionStore |
Laravel Cache adapter for ProjectionStore . |
MemcachedProjectionStore |
Memcached adapter for ProjectionStore . |
ObjectSerializer |
Interface for object serialization. |
Pdo |
Decorating interface for PHP Data Objects (PDO). |
PdoAggregateStore |
PDO adapter for AggregateStore . |
PdoEventStore |
PDO adapter for EventStore . |
PdoProjectionStore |
PDO adapter for ProjectionStore . |
PdoProxy |
Lazy-connecting PDO proxy. |
Problem |
Interface for Problem Details aware exceptions. |
Projection |
Interface for projections. |
ProjectionStore |
Persistence for projections. |
ReflectionObjectSerializer |
Reflection-based adapter for ObjectSerializer . |
Scenario |
Testing infrastructure on top of PHPUnit. |
SnapshotAggregateStoreMiddleware |
AggregateStore middleware for event-sourced aggregate snapshots. |
StreamEnricher |
Interface for event stream enrichers. |
StreamEnricherEventBusMiddleware |
EventBus middleware for event stream enrichment with StreamEnricher . |
StreamEnricherEventStoreMiddleware |
EventStore middleware for event stream enrichment with StreamEnricher`. |
StreamPublishingInspection |
Publish event streams from EventStore inspection. |
Uuid |
Universally Unique IDentifier (UUID) generation. |
Testing
$ vendor/bin/phpunit
Credits
License
The MIT License (MIT). Please see License File for more information.