Skip to content

Instantly share code, notes, and snippets.

@burzum
Created January 28, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burzum/62730db02a27198f851e044aab07a0e3 to your computer and use it in GitHub Desktop.
Save burzum/62730db02a27198f851e044aab07a0e3 to your computer and use it in GitHub Desktop.
<?php
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle6\Client;
use Prooph\EventStore\ExpectedVersion;
use Prooph\EventStore\EventData;
use Prooph\EventStore\UserCredentials;
use Prooph\EventStoreHttpClient\ConnectionSettings;
use Prooph\EventStoreHttpClient\EventStoreConnectionFactory;
$userCredentials = new UserCredentials('admin', 'changeit');
$connection = EventStoreConnectionFactory::create(
new ConnectionSettings(new \Prooph\EventStore\EndPoint('127.0.0.1', 2113)),
new Client(new GuzzleClient())
);
$connection->appendToStream('test', ExpectedVersion::ANY, [
new EventData(null, 'test', true, '{"foo": "bar"}')
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment