Download the PHP package milpa/event-store without Composer
On this page you can find all versions of the php package milpa/event-store. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download milpa/event-store
More information about milpa/event-store
Files in milpa/event-store
Download milpa/event-store
More information about milpa/event-store
Files in milpa/event-store
Vendor milpa
Package event-store
Short Description Append-only event-log primitive for the Milpa PHP framework: durable JSONL file store and in-memory store behind a common EventStoreInterface — per-stream replay and store-wide monotonic sequencing.
License Apache-2.0
Package event-store
Short Description Append-only event-log primitive for the Milpa PHP framework: durable JSONL file store and in-memory store behind a common EventStoreInterface — per-stream replay and store-wide monotonic sequencing.
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package event-store
# Milpa Event Store
> A tiny **append-only event log** for the Milpa PHP framework, with **zero package dependencies**. Append events, replay a stream, project state from the fold. Two interchangeable stores — **file** (JSONL) and **in-memory** — behind one `EventStoreInterface`. The persistence primitive under Milpa's event-sourced process engine.
[](https://github.com/getmilpa/event-store/actions/workflows/ci.yml)
[](https://packagist.org/packages/milpa/event-store)
[](https://www.php.net/)
[](LICENSE)
[](https://getmilpa.github.io/event-store/)
`milpa/event-store` is the smallest possible seam onto an append-only log: an `Event` is an
immutable fact — `streamId`, `type`, `payload`, `seq`, `recordedAt` — and a store's only two jobs are
"append durably" and "read a stream back in order". **No ORM, no serializer, no framework
coupling** — construct a store with a path (or nothing at all) and call `append()`.
`recordedAt` is a UTC-serialized wall-clock observation made by the process constructing a new
event. It says when that process's clock observed the record, not when the domain event objectively
happened, and it is no more trustworthy than that process and clock. Legacy records replay with
`recordedAt === null`; the store never invents their time from filenames, file metadata, or payloads.
## Install
## Quick example
Project current state by folding the replayed events yourself — the store never stores
state, only the facts it was told:
## Two stores, one interface
| Store | Durability | Use it for |
|-------|-----------|------------|
| `FileEventStore` | Appends one JSON line per event to a flat file, under an exclusive `flock()` so concurrent appenders never interleave partial lines. `nextSeq()` and `replay()` both re-derive their answer from the file itself — a fresh instance pointed at the same path, in a different process or a different request, agrees with every other instance about both "what happened" and "what comes next". | Real persistence — the process engine's durable log. |
| `InMemoryEventStore` | An in-process array. Nothing is written to disk; nothing survives past the instance's lifetime. | Tests, and zero-file consumers that don't need durability. |
Both implement the same four-method `EventStoreInterface` (`append()`, `replay()`,
`nextSeq()`, `streams()`), verified by one shared contract test suite
(`EventStoreContractTestCase`) so behavior — sequencing, stream isolation, replay order —
never drifts between the two.
## Requirements
- PHP **≥ 8.3**
- Nothing else — `milpa/event-store` has no package dependencies, Milpa or otherwise
## Documentation
**Full API reference: [getmilpa.github.io/event-store](https://getmilpa.github.io/event-store/)** —
generated straight from the source DocBlocks and dressed with the Milpa design system.
## Contributing
Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Please report security
issues via [SECURITY.md](SECURITY.md), and note that this project follows a
[Code of Conduct](CODE_OF_CONDUCT.md).
## License
[Apache-2.0](LICENSE) © Rodrigo Vicente - TeamX Agency.
---
Milpa is designed, built, and maintained by **[Rodrigo Vicente - TeamX Agency](https://teamx.agency/?utm_source=github&utm_medium=readme&utm_campaign=milpa&utm_content=event-store)**.
All versions of event-store with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.3
The package milpa/event-store contains the following files
Loading the files please wait ...