-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adding PHP8 support - dropping unsupported versions - upgrading to phpunit v9 - removing dependency for phpunit v7 due its dependency to php7.1 - running tests and code analysis on PHP8 - symfony/flex changed default branch name
- Loading branch information
1 parent
9c4dd67
commit 67ac599
Showing
81 changed files
with
883 additions
and
315 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* This file is part of prooph/event-store-symfony-bundle. | ||
* (c) 2014-%year% Alexander Miertsch <[email protected]> | ||
* (c) 2015-%year% Sascha-Oliver Prolic <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ |
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 |
---|---|---|
@@ -1,29 +1,28 @@ | ||
New BSD License | ||
=============== | ||
|
||
Copyright (c) 2016 - 2019, Alexander Miertsch <[email protected]> and Sascha-Oliver Prolic <[email protected]> | ||
Copyright (c) 2014-2021, Alexander Miertsch | ||
Copyright (c) 2015-2021, 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 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 names of the copyright holders nor the names of its | ||
contributors may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
* Neither the name of prooph 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. | ||
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
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
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
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,119 @@ | ||
# Migrating from 0.8.0 | ||
|
||
Due to [the future of prooph components](https://www.sasaprolic.com/2018/08/the-future-of-prooph-components.html) | ||
and [ES/Service-Bus discussion](https://github.com/prooph/event-sourcing/issues/90) | ||
, `prooph/event-sourcing` dependency was dropped for this bundle after `0.8.0`. You can still use it, but additional work | ||
must be done after upgrading this bundle to `0.9.0` or further. | ||
|
||
## Explicit installation of event sourcing component | ||
|
||
`prooph/event-sourcing` is still available and can be installed by single composer command | ||
|
||
```console | ||
$ composer install prooph/event-sourcing | ||
``` | ||
|
||
## Explicit definition of aggregate repositories | ||
|
||
Aggregate repositories were part of `prooph/event-sourcing` and without it, bundle will no longer register repositories | ||
as a services. You have to configure those by yourself. Let's consider following configuration | ||
|
||
```yaml | ||
prooph_event_store: | ||
stores: | ||
default: | ||
event_store: 'Prooph\EventStore\EventStore' | ||
repositories: | ||
some_aggregate: | ||
repository_class: App\Infrastructure\Persistence\SomeAggregateRepository | ||
aggregate_type: App\Domain\Model\SomeAggregate | ||
aggregate_translator: Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator | ||
stream_name: 'some_aggregate_stream' | ||
|
||
projection_managers: | ||
default_projection_manager: | ||
event_store: '@prooph_event_store.default' | ||
connection: '@app.event_store.pdo' | ||
projections: | ||
some_projection: | ||
read_model: App\Infrastructure\Projection\SomeProjectionReadModel | ||
projection: App\Infrastructure\Projection\SomeProjection | ||
|
||
services: | ||
Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator: ~ | ||
|
||
Prooph\EventStore\EventStore: | ||
class: 'Prooph\EventStore\Pdo\PostgresEventStore' | ||
arguments: | ||
- '@prooph_event_store.message_factory' | ||
- '@app.event_store.pdo' | ||
- '@app.event_store.persistence_strategy' | ||
|
||
app.event_store.pdo: | ||
class: \PDO | ||
|
||
app.event_store.mysql.persistence_strategy: | ||
class: Prooph\EventStore\Pdo\PersistenceStrategy\PostgresSimpleStreamStrategy | ||
``` | ||
As you can see, there is a single EventStore configured with one repository. To make application work the same you have | ||
to | ||
1. define a service of class `Prooph\EventSourcing\Aggregate\AggregateType` and `Prooph\EventStore\StreamName` for each | ||
aggregate, so it can be injected into repository | ||
2. define each repository as a service | ||
|
||
Your configuration should be transformed as follows | ||
|
||
```yaml | ||
prooph_event_store: | ||
stores: | ||
default: | ||
event_store: 'Prooph\EventStore\EventStore' | ||
projection_managers: | ||
default_projection_manager: | ||
event_store: '@prooph_event_store.default' | ||
connection: '@app.event_store.pdo' | ||
projections: | ||
some_projection: | ||
read_model: App\Infrastructure\Projection\SomeProjectionReadModel | ||
projection: App\Infrastructure\Projection\SomeProjection | ||
services: | ||
Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator: ~ | ||
Prooph\EventStore\EventStore: | ||
class: 'Prooph\EventStore\Pdo\PostgresEventStore' | ||
arguments: | ||
- '@prooph_event_store.message_factory' | ||
- '@app.event_store.pdo' | ||
- '@app.event_store.persistence_strategy' | ||
app.some_aggregate.type: | ||
class: 'Prooph\EventSourcing\Aggregate\AggregateType' | ||
factory: [ 'Prooph\EventSourcing\Aggregate\AggregateType', 'fromAggregateRootClass' ] | ||
arguments: | ||
- 'App\Domain\Model\SomeAggregate' | ||
app.some_aggregate.stream: | ||
class: 'Prooph\EventStore\StreamName' | ||
arguments: | ||
- 'some_aggregate_stream' | ||
App\Infrastructure\Persistence\SomeAggregateRepository: | ||
arguments: | ||
$eventStore: '@prooph_event_store.default' | ||
$aggregateType: '@app.some_aggregate.type' | ||
$aggregateTranslator: Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator | ||
$streamName: '@app.some_aggregate.stream' | ||
$oneStreamPerAggregate: true | ||
app.event_store.pdo: | ||
class: \PDO | ||
app.event_store.mysql.persistence_strategy: | ||
class: Prooph\EventStore\Pdo\PersistenceStrategy\PostgresSimpleStreamStrategy | ||
``` | ||
|
||
A bit overloading, but writing Event Sourcing component by yourself is quite easy (it takes few classes to work). |
Oops, something went wrong.