定制 mauretto78/simple-event-store-manager-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mauretto78/simple-event-store-manager-bundle

Composer 安装命令:

composer require mauretto78/simple-event-store-manager-bundle

包简介

PHP Bundle

README 文档

README

Codacy Badge license Packagist

This is the official Symfony bundle for Simple EventStore Manager package.

Install Guide

Step 1: Include Simple EventStore Manager Bundle in your project with composer:

composer require mauretto78/simple-event-store-manager-bundle

Step 2: Setup your config.yml to configure your driver and connection parameters

Here is an example:

# Simple EventStore Manager
simple_event_store_manager:
    driver: 'mongo'
    api_format: 'yaml'
    parameters:
        host: 'localhost'
        username: ~
        password: ~
        database: 'eventstore_demo'
        port: '27017'
    return_type: 'array'   
    elastic:
        host: 'localhost'
        port: '9200'
  • return_type is an optional parameter; you can choose between array or object to return aggregates
  • api_format is an optional parameter; you can choose between json (default), xml or yaml
  • elastic is an optional parameter; you can send your events to a Elastic server

Please refer to Simple EventStore Manager page for more details.

Step 3: Setup your AppKernel.php by adding the Simple EventStore Manager Bundle

// ..
$bundles[] = new SimpleEventStoreManager\Bundle\SimpleEventStoreManagerBundle();

Step 4: Setup yor routing.yml

Add these lines at the bottom of your routing.yml file:

_simple_event_store_manager:
    resource: '@SimpleEventStoreManagerBundle/Resources/config/routing.yml'

Usage Guide

You can use EventsManager in your Controllers:

// ..

$manager = $this->container->get('simple_event_store_manager');
$eventManager = $manager->getEventMananger();

// store events in an aggregate
$eventManager->storeEvents(
    'name-of-your-aggregate',
    [
        ...
    ]
);

// get event streams
$eventQuery = $eventStoreManager->getEventQuery();

$stream = $eventQuery->fromAggregate('Your aggregate');
foreach ($stream as $event){
    // ..
}

Or inject it into your services and classes:

services:
     # ...

     AppBundle\Your\Service:
         arguments: ['@simple_event_store_manager']
         

Please refer to official documentation of Simple EventStore Manager for basic usage of this Library.

API support

An API endpoint is automatically exposed to /_events/{aggregate}/{page} route; it will automatically paged with 25 records per page.

When a page is complete, it will set automatically an infinite cache on it.

Support

If you found an issue or had an idea please refer to this section.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固