neos / eventstore-doctrineadapter
基于Doctrine DBAL的neos/eventstore实现
2.0.1
2024-03-22 15:07 UTC
Requires
- php: ^8.1
- doctrine/dbal: ^3
- neos/eventstore: ^1
- psr/clock: ^1
- webmozart/assert: ^1.10
Requires (Dev)
- brianium/paratest: ^7.2
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^4.0.x-dev
This package is auto-updated.
Last update: 2024-09-22 16:36:04 UTC
README
为neos/eventstore包提供数据库适配器实现。
注意 目前此包支持MySQL(包括MariaDB)、PostgreSQL和SQLite。
用法
通过composer安装
composer require neos/eventstore-doctrineadapter
创建实例
要创建DoctrineEventStore
,需要\Doctrine\DBAL\Connection
的实例。例如,可以从DSN获取
use Doctrine\DBAL\DriverManager; $connection = DriverManager::getConnection(['url' => $dsn]);
有关详细信息,请参阅Doctrine文档。
有了这些,可以创建一个事件存储实例
use Neos\EventStore\DoctrineAdapter\DoctrineEventStore; $eventTableName = 'some_namespace_events'; $eventStore = new DoctrineEventStore($connection, $eventTableName);
请参阅neos/eventstore
包的README,了解如何编写和读取事件。
贡献
许可
请参阅LICENSE