lzakrzewski / http-event-store
Client for communication with event store http api
Installs: 69
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/lzakrzewski/http-event-store
Requires
- php: >=5.6
- guzzlehttp/guzzle: ~6.0
- ramsey/uuid: ~3.0
Requires (Dev)
- phpunit/phpunit: ~5.0
This package is not auto-updated.
Last update: 2025-10-06 16:45:40 UTC
README
Client for communication with Event Store HTTP API
.
Read more about Event Store HTTP API
http://docs.geteventstore.com/http-api/latest.
This library is independent part of es-sandbox.
Requirements
"require": { "php": ">=5.6", "guzzlehttp/guzzle": "~6.0", "ramsey/uuid" : "~3.0" }
Installation
Require the library with composer:
composer require lzakrzewski/http-event-store
Usage
Example
$streamId = Uuid::uuid4()->toString(); $eventStore = \HttpEventStore\Http\HttpEventStore::create('127.0.0.1', '2113'); $event1 = new \HttpEventStore\WritableEvent('productWasAddedToBasket', ['productId' => 'product1', 'name' => 'Teapot']); $event2 = new \HttpEventStore\WritableEvent('productWasRemovedFromBasket', ['productId' => 'product1']); // Writing to a Stream $eventStore->writeStream($streamId, [$event1, $event2]); // Reading from a Stream $events = $eventStore->readStream($streamId); // Your logic with events there...