Friends of Ouro

Event Sourcing & KurrentDB PHP Libraries

Open source PHP libraries for event sourcing

Friends of Ouro

Open source PHP libraries for event sourcing and KurrentDB (formerly EventStoreDB) integration. Our mission is to provide modern, type-safe, and well-tested PHP tools for building event-driven applications.

Our Projects

🏗️ KurrentDB PHP Core

The main PHP client library for KurrentDB HTTP API

PHP 8 Latest Stable Version

composer require friendsofouro/kurrentdb-core

📚 Documentation & Source Code

📦 KurrentDB PHP (Metapackage)

Convenience package with good defaults

This metapackage includes kurrentdb-core with sensible default dependencies, perfect for quick setup.

composer require friendsofouro/kurrentdb-php

🔗 GitHub Repository

🎯 KurrentDB Symfony Bundle

Symfony 7.3+ integration bundle

Seamless integration of KurrentDB into your Symfony applications with dependency injection, configuration management, and more.

composer require friendsofouro/kurrentdb-bundle

📘 Bundle Documentation

🐳 KurrentDB Docker Example

Simple Docker setup for local development

Ready-to-use Docker Compose configuration for running KurrentDB locally. Perfect for development and testing.

🐋 Get Docker Setup

🔌 HTTP Batch Contract

PSR-18 interface contracts for batch HTTP requests

Defines the standard interfaces for handling multiple HTTP requests efficiently. Used internally by KurrentDB libraries for optimized batch operations.

composer require friendsofouro/http-batch-contract

🔗 Contract Documentation

⚡ HTTP Batch Guzzle

Guzzle implementation for efficient batch HTTP processing

High-performance Guzzle-based implementation of the HTTP batch contracts with caching support and concurrent request handling.

composer require friendsofouro/http-batch-guzzle

🚀 Implementation Guide

Getting Started

Quick Example

use KurrentDB\EventStore;
use FriendsOfOuro\Http\Batch\Guzzle\GuzzleHttpClient;
use KurrentDB\WritableEvent;
use KurrentDB\ValueObjects\Identity\UUID;
use GuzzleHttp\Psr7\HttpFactory;

// Create client
$httpFactory = new HttpFactory();
$httpClient = new GuzzleHttpClient();

$eventStore = new EventStore(
    $httpFactory->createUri('http://admin:changeit@127.0.0.1:2113'),
    $httpFactory,  // UriFactory
    $httpFactory,  // RequestFactory
    $httpClient
);

// Write events
$event = new WritableEvent(
    new UUID(),
    'user-registered',
    ['userId' => '123', 'email' => 'user@example.com']
);

$version = $eventStore->writeToStream('user-123', $event);

// Read events
foreach ($eventStore->forwardStreamFeedIterator('user-123') as $entry) {
    echo "Event: " . $entry->getEvent()->getType() . "\n";
}

Requirements

Contributing

We welcome contributions! Each repository has its own contributing guidelines:

Feel free to open issues, submit pull requests, or discuss improvements in our GitHub repositories.