eventdbx/eventdbx-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eventdbx/eventdbx-php

最新稳定版本:v0.1.2

Composer 安装命令:

composer require eventdbx/eventdbx-php

包简介

PHP SDK for EventDBX.

README 文档

README

This SDK talks to the EventDBX control socket directly over Cap'n Proto + Noise via a small Rust native library exposed through PHP FFI.

Build the native library

cd native
cargo build --release

The compiled library will land in native/target/release:

  • macOS: libeventdbx_php_native.dylib
  • Linux: libeventdbx_php_native.so
  • Windows: eventdbx_php_native.dll

If you prefer a debug build, use cargo build and point the PHP loader at native/target/debug.

PHP usage

use EventDbx\Client;

$client = new Client([
    'host' => '127.0.0.1',
    'port' => 6363,
    'token' => getenv('EVENTDBX_TOKEN'),
    // 'tenantId' => 'default',
    // 'noNoise' => true, // only when the server allows plaintext
]);

$page = $client->list('person', ['take' => 10]);
$created = $client->create('person', 'p-1', 'person_registered', [
    'payload' => ['name' => 'Ada'],
    'metadata' => ['@source' => 'sdk-demo'],
]);
$client->apply('person', 'p-1', 'person_updated', [
    'payload' => ['status' => 'active'],
]);
$events = $client->events('person', 'p-1');
$verify = $client->verify('person', 'p-1');

All client methods return associative arrays decoded from the JSON responses:

  • list: { items: [...], nextCursor: string|null }
  • events: { items: [...], nextCursor: string|null }
  • get: { found: bool, aggregate: mixed }
  • select: { found: bool, selection: mixed }
  • create: { aggregate: mixed }
  • apply / patch: { event: mixed }
  • archive / restore: { aggregate: mixed }
  • verify: { merkleRoot: string }
  • createSnapshot: { snapshot: mixed }
  • listSnapshots: { items: [...snapshot rows...] }
  • getSnapshot: { found: bool, snapshot: mixed }

Requirements

  • PHP 8.1+ with the ffi extension enabled.
  • Rust toolchain to build the native library.
  • Access to an EventDBX control endpoint and token.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Rust

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-27