-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
134 changed files
with
7,853 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Copyright (c) 2018-2018, prooph software GmbH | ||
Copyright (c) 2018-2018, Sascha-Oliver Prolic | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the prooph software GmbH nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Prooph Event Store | ||
|
||
Common classes and interface for Prooph Event Store implementations. | ||
|
||
[![Build Status](https://travis-ci.org/prooph/event-store.svg?branch=master)](https://travis-ci.org/prooph/event-store) | ||
[![Coverage Status](https://coveralls.io/repos/github/prooph/event-store/badge.svg?branch=master)](https://coveralls.io/github/prooph/event-store?branch=master) | ||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/prooph/improoph) | ||
|
||
## Installation | ||
|
||
You can install prooph/event-store via composer by adding `"prooph/event-store": "dev-master"` as requirement to your composer.json. | ||
|
||
### Available persistent implementations | ||
|
||
- [Event Store Client](https://github.com/prooph/event-store-client) for async TCP connections | ||
- [Event Store HTTP Client](https://github.com/prooph/event-http-store-client) for HTTP connections | ||
|
||
## Documentation | ||
|
||
See: [https://github.com/prooph/documentation](https://github.com/prooph/documentation) | ||
|
||
Will be published on the website soon. | ||
|
||
## Support | ||
|
||
- Ask questions on Stack Overflow tagged with [#prooph](https://stackoverflow.com/questions/tagged/prooph). | ||
- File issues at [https://github.com/prooph/event-store/issues](https://github.com/prooph/event-store/issues). | ||
- Say hello in the [prooph gitter](https://gitter.im/prooph/improoph) chat. | ||
|
||
## Contribute | ||
|
||
Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! | ||
To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation. | ||
|
||
## Version Guidance | ||
|
||
| Version | Status | PHP Version | Support Until | | ||
|---------|-------------|-------------|---------------| | ||
| 5.x | EOL | >= 5.5 | EOL | | ||
| 6.x | Maintained | >= 5.5 | 3 Dec 2017 | | ||
| 7.x | Latest | >= 7.1 | active | | ||
| 8.x | Development | >= 7.2 | active | | ||
|
||
## License | ||
|
||
Released under the [New BSD License](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "prooph/event-store-", | ||
"type": "library", | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Sascha-Oliver Prolic", | ||
"email": "saschaprolic@googlemail.com" | ||
} | ||
], | ||
"description": "Event Store v8", | ||
"keywords": [ | ||
"EventStore", | ||
"EventSourcing", | ||
"DDD", | ||
"prooph" | ||
], | ||
"prefer-stable": true, | ||
"require": { | ||
"php": "^7.2", | ||
"ext-json": "*", | ||
"ramsey/uuid": "^3.7.3" | ||
}, | ||
"require-dev": { | ||
"amphp/amp": "^2.0.7", | ||
"phpspec/prophecy": "^1.7", | ||
"phpunit/phpunit": "^7.4", | ||
"doctrine/instantiator": "^1.1", | ||
"sebastian/object-enumerator": "^3.0.3", | ||
"satooshi/php-coveralls": "^2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Prooph\\EventStore\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"ProophTest\\EventStore\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"check": [ | ||
"@cs", | ||
"@test" | ||
], | ||
"cs": "php-cs-fixer fix -v --diff --dry-run", | ||
"cs-fix": "php-cs-fixer fix -v --diff", | ||
"test": "phpunit" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
~ This file is part of the prooph/event-store-client. | ||
~ (c) 2018-2018 prooph software GmbH <contact@prooph.de> | ||
~ (c) 2018-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
~ | ||
~ For the full copyright and license information, please view the LICENSE | ||
~ file that was distributed with this source code. | ||
--> | ||
|
||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="vendor/autoload.php" | ||
failOnWarning="true" | ||
failOnRisky="true" | ||
> | ||
<testsuite name="Prooph EventStore Test Suite"> | ||
<directory suffix=".php">./tests</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of `prooph/event-store`. | ||
* (c) 2018-2018 prooph software GmbH <contact@prooph.de> | ||
* (c) 2018-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\EventStore; | ||
|
||
/** | ||
* This class contains constants to be used when setting up subscriptions | ||
* using the EventStoreAsyncConnection::subscribeToAllFromAsync method | ||
*/ | ||
class AllCheckpoint | ||
{ | ||
/** | ||
* Indicates that a catch-up subscription should receive all events in the database. | ||
*/ | ||
public const ALL_START = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of `prooph/event-store`. | ||
* (c) 2018-2018 prooph software GmbH <contact@prooph.de> | ||
* (c) 2018-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\EventStore; | ||
|
||
class AllEventsSlice | ||
{ | ||
/** @var ReadDirection */ | ||
private $readDirection; | ||
/** @var Position */ | ||
private $fromPosition; | ||
/** @var Position */ | ||
private $nextPosition; | ||
/** @var ResolvedEvent[] */ | ||
private $events; | ||
/** @var bool */ | ||
private $isEndOfStream; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @param ReadDirection $readDirection | ||
* @param Position $fromPosition | ||
* @param Position $nextPosition | ||
* @param ResolvedEvent[] $events | ||
*/ | ||
public function __construct( | ||
ReadDirection $readDirection, | ||
Position $fromPosition, | ||
Position $nextPosition, | ||
array $events | ||
) { | ||
$this->readDirection = $readDirection; | ||
$this->fromPosition = $fromPosition; | ||
$this->nextPosition = $nextPosition; | ||
$this->events = $events; | ||
$this->isEndOfStream = \count($events) === 0; | ||
} | ||
|
||
public function readDirection(): ReadDirection | ||
{ | ||
return $this->readDirection; | ||
} | ||
|
||
public function fromPosition(): Position | ||
{ | ||
return $this->fromPosition; | ||
} | ||
|
||
public function nextPosition(): Position | ||
{ | ||
return $this->nextPosition; | ||
} | ||
|
||
/** @return ResolvedEvent[] */ | ||
public function events(): array | ||
{ | ||
return $this->events; | ||
} | ||
|
||
public function isEndOfStream(): bool | ||
{ | ||
return $this->isEndOfStream; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of `prooph/event-store`. | ||
* (c) 2018-2018 prooph software GmbH <contact@prooph.de> | ||
* (c) 2018-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\EventStore; | ||
|
||
use Throwable; | ||
|
||
interface AsyncCatchUpSubscriptionDropped | ||
{ | ||
public function __invoke( | ||
AsyncEventStoreCatchUpSubscription $subscription, | ||
SubscriptionDropReason $reason, | ||
?Throwable $exception = null | ||
): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of `prooph/event-store`. | ||
* (c) 2018-2018 prooph software GmbH <contact@prooph.de> | ||
* (c) 2018-2018 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\EventStore; | ||
|
||
interface AsyncEventStoreAllCatchUpSubscription extends AsyncEventStoreCatchUpSubscription | ||
{ | ||
public function lastProcessedPosition(): Position; | ||
} |
Oops, something went wrong.