PHP 7.4 EventStore Implementation

Overview

Prooph Event Store

Common classes and interface for Prooph Event Store implementations.

Build Status Coverage Status Gitter

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

Documentation

See: https://github.com/prooph/documentation

Will be published on the website soon.

Support

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.4 active

License

Released under the New BSD License.

Comments
  • Poll: What do you prefer? Server or lib? Or both?

    Poll: What do you prefer? Server or lib? Or both?

    Question for the community: What would you prefer?

    A

    Connect the https://github.com/prooph/event-store-client to the "original" event-store (https://eventstore.org/)

    B

    Connect the https://github.com/prooph/event-store-client to a newly written event-store server implementation written in PHP

    C

    Use a simple library on top of a PDO connection (like event-store v7), no server implementation.

    You can vote multiple times, just leave a :+1: on mulitple answers.

    Pros / Cons of the different solutions:

    A

    Pro: The server from https://eventstore.org/ is the best solution available, has the most features and awesome performance.

    Con: Most PHP devs know a PHP / MySQL combo and would have to learn how to setup the event-store as well. Sometimes you can't make decisions on the stack used (but you can install any PHP lib you want to).

    B

    Pro: Way more features are possible to implement compares to a simple library on top of a PDO connection. Communication is with client / server, not directly via PDO connection.

    Con: Not all features from https://eventstore.org/ are possible to implement with PHP (but most). Communication is with client / server, not directly via PDO connection (I think some may see this as a con, so I list here again).

    C

    Pro: No additional server setup needed, not https://eventstore.org/ and not a newly written server implementation in PHP.

    Con: The smallest feature set of all solutions. Performance of projections is not as good.

    help wanted question 
    opened by prolic 37
  • Projection manager

    Projection manager

    • [x] added projection manager
    • [x] removed projection options class
    • [x] projection options constants
    • [x] added methods to fetch projection state, status and stream positions
    • [x] added common event store test for all implementations
    • [x] added common transactional event store test trait for all implementations
    • [x] added common projection manager test for all implementations
    • [x] added common event store projection test for all implementations
    • [x] added common event store query test for all implementations
    • [x] added common event store read model projection test for all implementations
    • [x] updated all fetch*-methods
    • [x] provided more tests
    • [x] some bug fixes

    supersedes https://github.com/prooph/event-store/pull/266

    resolves https://github.com/prooph/event-store/issues/265

    resolves https://github.com/prooph/event-store/issues/257

    /cc @oqq

    enhancement 
    opened by prolic 25
  • Problem with ActionEventEmitterEventStore and Projections

    Problem with ActionEventEmitterEventStore and Projections

    Currently it delegates the projection creation to the used event store implementation. This is a problem, as the wrapped event store is then not used in the projection itself, and you cannot attach listeners to it during projection's emit and linkTo.

    $eventStore->createProjection($eventStore) would solve the issue (adding event store as optional parameter, which will only be set by action event emitter event store) - but this looks weird and might lead to some people injecting a complete different event store instance, which would be cleary wrong.

    Ideas?

    @codeliner @oqq @bweston92

    bug 
    opened by prolic 24
  • RFC load max events and direction & RFC remove Adapter::replay

    RFC load max events and direction & RFC remove Adapter::replay

    Implementation for:

    RFC load max events and direction https://github.com/prooph/event-store/issues/198

    RFC Remove Adapter::replay method https://github.com/prooph/event-store/issues/190

    enhancement BC break 
    opened by prolic 22
  • Make Projections more abstract

    Make Projections more abstract

    The current base implementation of ProjectionOptions has some mandatory values with defaults, which would not be used in every projection class. There is also an inheritance in PdoEventStoreProjection to add more options. To provide one value other than the defaults, I have to investigate the default values in the class and add they by myself in the constructor, otherwise the object could not be build.

    I guess this would escalate.

    My proposal is to make this DTO more abstract, so it can be used in every current and future implementation of projection and here factories.

    Default values required by the factories should be defined by the factory and not in an abstract DTO. Also, every projection should know which options are mandatory.

    Here is an example implementation to be more clear what I am talking about: https://gist.github.com/oqq/c709eae6d993b49d888d15703a466f30

    This would be a bc break and should not implemented in an already beta version. But I guess there is not an implementation for projections out there other than from us.

    What do you think about that? @prolic @codeliner

    enhancement 
    opened by oqq 21
  • RFC event-store-ui

    RFC event-store-ui

    A user-interface for inspection of the event-store would be a great new feature. This can be done in a separate package. An event-store HTTP API would be needed, see: https://github.com/prooph/event-store/issues/194

    enhancement question 
    opened by prolic 20
  • RFC load max events and direction

    RFC load max events and direction

    The current interface is:

    public function load(StreamName $streamName, int $minVersion = null): Stream

    I want to change to:

    public function load(StreamName $streamName, int $minVersion = null, int $maxVersion = null, bool $forward = true): Stream

    to allow loading events in a given range only (useful for http api f.e., see: https://github.com/prooph/event-store/issues/194) and additionally you can load the events in reverse order.

    Similar to this loadEvents needs to be updated, too.

    enhancement 
    opened by prolic 18
  • rename projection => projector where applicable

    rename projection => projector where applicable

    move constants from projection manager to projector interfaces

    resolves https://github.com/prooph/event-store/issues/273

    Please check the new naming and check for consistency where it's still called projection, and where it's now called projector, f.e.

    ProjectionManager::createProjection(): Projector
    

    /cc @basz @oqq @bweston92

    If accepted, we need to update pdo-event-store before merging, then we are ready for next beta I guess

    enhancement 
    opened by prolic 17
  • [7.x] Add PHP8 to travis / PHP8 support

    [7.x] Add PHP8 to travis / PHP8 support

    • ~~Travis is currently missing the PHP 8 option ( https://travis-ci.community/t/php-8-0-missing/10132/17 ) but should be available next week~~
    • This is mostly to see if/what needs to change to PHP8 support

    Changes:

    • [x] Updated the README badges to link to the correct branch for this version
    • [x] Use ProphesizeTrait, prophesize integration has been moved into its own package phpspec/prophecy-phpunit
    • [x] Replaced calls to assertInternalType() with new assertions ( old ones have been removed )
    • [x] assertRegExp is deprecated and replaced
    • [x] Annotated a few tests with @medium that were running longer than 1 second and thus being stopped
    • [x] Update travis
    • [x] Fix at deprecation warnings in phpunit
    • [x] Update Doc-Header for 2021
    opened by fritz-gerneth 14
  • Introducing NonTransactionalInMemoryEventStore

    Introducing NonTransactionalInMemoryEventStore

    Solves incompatibility of InMemoryEventStore and PdoEventStore as explained in this SO question: https://stackoverflow.com/questions/46769347/how-to-solve-incompatibility-of-inmemoryeventstore-and-pdoeventstore-in-prooph/46806028#46806028

    enhancement 
    opened by tomcizek 14
  • Use ULID instead of autoincrement no

    Use ULID instead of autoincrement no

    We can get rid of the autoincrement requirement for an event store if we use Universally Unique Lexicographically Sortable Identifier. This would be a huge improvement.

    The assumption why autoincrement no is needed is:

    1. Sort events ASC or DESC
    2. Get events prior or after specific number

    Try it out with php-ulid.

            $docs = [];
    
            for ($i=0; $i<100; $i++) {
                $docs[] = [
                    'position' => $i,
                    'ulid' => (string)Ulid::generate(true),
                ];
            }
    

    It works in ArangoDB for instance.

    FOR u IN transactionCol
      FILTER u.ulid <= "01d4dn314dz3pp0n423pfggjv2"
      SORT u.ulid ASC
      RETURN u
    
    question 
    opened by sandrokeil 12
  • Update vimeo/psalm requirement from ^4.9.3 to ^4.9.3 || ^5.0.0

    Update vimeo/psalm requirement from ^4.9.3 to ^4.9.3 || ^5.0.0

    Updates the requirements on vimeo/psalm to permit the latest version.

    Release notes

    Sourced from vimeo/psalm's releases.

    Psalm 5

    Welcome to Psalm 5!

    There's an accompanying post on psalm.dev, written by @​muglug & the current maintainers of Psalm.

    What's Changed

    Removed

    Features

    ... (truncated)

    Commits
    • 4e177bf Merge pull request #8790 from malarzm/patch-1
    • 7877570 Remove CallMapTest.php from Psalm self-analysis
    • 28188d1 Remove unfinished sentence
    • 6fff6df Merge pull request #8788 from weirdan/fix-xml-report-crashes-on-8.1
    • 874eb7d Fix crashes when XML report is used on PHP 8.1
    • 9d597cf Merge pull request #8782 from weirdan/check-runtime-requirements
    • 94dac9f Merge pull request #8783 from weirdan/bump-slevomat-coding-standard
    • ed36f2c Bump slevomat/coding-standard
    • 8fa35c2 Variables should outlive namespaces (#8779)
    • 05b8e0e Replace all references to static variables when moving class (#8780)
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • SEO when search for `Prooph Add Metadata`

    SEO when search for `Prooph Add Metadata`

    I tried to search for Prooph Add Metadata and got this page as 1st result: http://getprooph.org/docs/html/event-store/event_store.html

    I think the right/updated documentation in different host: http://docs.getprooph.org/event-store/event_store_plugins.html#3-3-4

    I think it's important to have results in google to redirect to right documentation :)

    Thanks

    opened by ahmed-alaa 4
Releases(v7.8.0)
Owner
CQRS and EventSourcing Infrastructure for PHP
null
Event-driven, non-blocking I/O with PHP.

Event-driven, non-blocking I/O with PHP. ReactPHP is a low-level library for event-driven programming in PHP. At its core is an event loop, on top of

ReactPHP 8.5k Jan 8, 2023
A non-blocking concurrency framework for PHP applications. 🐘

Amp is a non-blocking concurrency framework for PHP. It provides an event loop, promises and streams as a base for asynchronous programming. Promises

Amp 3.8k Jan 6, 2023
Icicle is a PHP library for writing asynchronous code using synchronous coding techniques

Icicle is now deprecated in favor of Amp v2.0. This version is is currently under development, but close to release. The v2.0 branches are amp_v2 in a

icicle.io 1.1k Dec 21, 2022
Événement is a very simple event dispatching library for PHP.

Événement Événement is a very simple event dispatching library for PHP. It has the same design goals as Silex and Pimple, to empower the user while st

Igor 1.2k Jan 4, 2023
Asynchronous coroutines for PHP 7.

Recoil An asynchronous coroutine kernel for PHP 7. composer require recoil/recoil The Recoil project comprises the following packages: recoil/api - T

Recoil 787 Dec 8, 2022
A pragmatic event sourcing library for PHP with a focus on developer experience.

EventSaucePHP EventSauce is a somewhat opinionated, no-nonsense, and easy way to introduce event sourcing into PHP projects. It's designed so storage

EventSauce 685 Dec 31, 2022
Reactive extensions for PHP.

This package is abandoned. Use https://github.com/ReactiveX/RxPHP instead Rx.PHP Reactive extensions for PHP. The reactive extensions for PHP are a se

Alexander 208 Apr 6, 2021
Golang's defer statement for PHP

PHP Defer A defer statement originally comes from Golang. This library allows you to use defer functionality in PHP code. Usage <?php defer($context,

null 249 Dec 31, 2022
Reactive extensions for PHP

RxPHP Reactive extensions for PHP. The reactive extensions for PHP are a set of libraries to compose asynchronous and event-based programs using obser

ReactiveX 1.6k Dec 12, 2022
🚀 Coroutine-based concurrency library for PHP

English | 中文 Swoole is an event-driven asynchronous & coroutine-based concurrency networking communication engine with high performance written in C++

Swoole Project 17.7k Jan 5, 2023
PHP Application using DDD CQRS Event Sourcing with Hexagonal Architecture

PHP Application using DDD CQRS Event Sourcing with Hexagonal Architecture Application built with Ecotone Framework and powered by integrations with Pr

EcotoneFramework 65 Dec 27, 2022
Revolt is a rock-solid event loop for concurrent PHP applications.

Revolt is a rock-solid event loop for concurrent PHP applications.

Revolt PHP 586 Jan 2, 2023
A PHP implementation of the GraphQL specification based on the JavaScript reference implementation

GraphQL This is a PHP implementation of the GraphQL specification based on the JavaScript reference implementation. Related projects DateTime scalar R

Digia 219 Nov 16, 2022
A PHP VM implementation in PHP

PHPPHP A PHP VM implementation written in PHP. This is a basic VM implemented in PHP using the AST generating parser developed by @nikic To see what's

Anthony Ferrara 801 Dec 25, 2022
Retrofit implementation in PHP. A REST client for PHP.

Retrofit PHP Retrofit is a type-safe REST client. It is blatantly stolen from square/retrofit and implemented in PHP. ❗ UPGRADE NOTICE ❗ Version 3 int

null 153 Dec 21, 2022
Zipkin PHP is the official PHP Tracer implementation for Zipkin

Zipkin PHP is the official PHP Tracer implementation for Zipkin, supported by the OpenZipkin community. Installation composer require openz

Open Zipkin 250 Nov 12, 2022
A pure PHP implementation of the MessagePack serialization format / msgpack.org[PHP]

msgpack.php A pure PHP implementation of the MessagePack serialization format. Features Fully compliant with the latest MessagePack specification, inc

Eugene Leonovich 368 Dec 19, 2022
Php-rpc-server - JSON RPC server implementation for PHP.

JSON RPC Server implementation for PHP. The json-rpc is a very simple protocol. You can see this by reading the protocol specification. This library i

null 4 Sep 28, 2022
A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

Felix Becker 1.1k Jan 4, 2023
Pure PHP implementation of GraphQL Server – Symfony Bundle

Symfony GraphQl Bundle This is a bundle based on the pure PHP GraphQL Server implementation This bundle provides you with: Full compatibility with the

null 283 Dec 15, 2022