1. Go to this page and download the library: Download cocoders/event-store library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$eventStore = new MyEventStore();
$eventSubscribers = new EventSubscribers();
$eventBus = new EventBus($eventSubscribers);
$projectionManager = new ProjectionManager($eventSubscribers);
$projectionManager->registerProjection(
'InvoiceIssued',
new MyProjection()
);
$newEventsStream = $eventStore->findUncommited(new EventStream\Name(Invoice::class));
$eventStore->commit();
$eventStore->notify($newEventsStream); //now event bus will notify projections as well
bash
composer install
php bin/phpspec run -fpretty
php bin/phpunit
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.