Download the PHP package phariscope/event-store without Composer
On this page you can find all versions of the php package phariscope/event-store. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phariscope/event-store
More information about phariscope/event-store
Files in phariscope/event-store
Package event-store
Short Description To develop event stores this package is start base.
License MIT
Homepage https://github.com/phariscope/EventStore
Informations about the package event-store
Installation
Supported versions
| Supported | |
|---|---|
| PHP | >=8.1 (Symfony 8 requires PHP >=8.4 on the application side; Composer will resolve accordingly) |
Symfony (config, dependency-injection, http-kernel, serializer, yaml) |
6.4 LTS, 7.x, and 8.x per composer.json |
| phariscope/event | >=1.2 (1.2.x is the reference line used in CI) |
Continuous integration runs PHPUnit against Symfony 6.4, 7.4, and 8.0 lines (see .github/workflows/ci.yml).
Usage
There is no direct usage for this package. You should use this package only if you want to develop your own event storage component.
To develop your own storage:
- Create your own Store implementing the StoreInterface.
- Create your subscriber by extending PersistEventSubscriberAbstract, which can be constructed with your store.
Multiple implementations of the StoreInterface are provided:
- StoreEventInMemory: In-memory storage for testing and development
- StoreEventInDatabase: Persistent database storage using PDO
- StoreEventWithMetrics: Decorator adding performance monitoring to any store
Using the SQLite persistence listener
A ready-to-use listener is provided to persist every event into a SQLite database (or any PDO-supported database) using StoreEventInDatabase under the hood.
Prerequisites:
- PHP with
pdo_sqliteextension enabled (or another PDO driver if you use a different DBMS)
Example:
Notes:
- The table is created automatically with the name you provide (default:
stored_events). - SQLite DSN formats:
sqlite::memory:for in-memorysqlite:/absolute/path/to/file.sqlitefor file-backed
YAML configuration
You can configure the SQLite path and table name via a YAML file and build the listener from it.
Example config/event_store.yaml:
Bootstrap from configuration:
Symfony Bundle integration
If you are using Symfony, enable the bundle and configure it under config/packages/event_store.yaml:
1) Register the bundle (Symfony Flex may do this automatically):
2) Configure the package:
Services exposed:
phariscope_event_store.pdo: configuredPDOinstancephariscope_event_store.subscriber:PersistEventInDatabaseSubscriber
Additional features include:
- Event versioning with VersionedEvent for schema evolution
- Performance metrics tracking with EventStoreMetrics
- Event filtering by type and time ranges
- Comprehensive API documentation in docs/API.md
To Contribute to phariscope/Event
Requirements
- docker
- git
Install
- git clone [email protected]:phariscope/EventStore.git
Unit test
Using Test-Driven Development (TDD) principles (thanks to Kent Beck and others), following good practices (thanks to Uncle Bob and others) and the great book 'DDD in PHP' by C. Buenosvinos, C. Soronellas, K. Akbary
Quality
- phpcs PSR12
- phpstan level 9
- coverage 100%
- infection MSI 100%
Quick check with:
Check coverage with:
and view 'var/index.html' with your browser
Check infection with:
and view 'var/infection.html' with your browser
All versions of event-store with dependencies
phariscope/event Version >=1.2
symfony/serializer Version ^6.0 || ^7.0 || ^8.0
symfony/yaml Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
phariscope/safephp Version ^1.0