bernard/silex 问题修复 & 功能扩展

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

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

bernard/silex

Composer 安装命令:

composer require bernard/silex

包简介

Silex service provider for Bernard

README 文档

README

Build Status

Brings Bernard to Silex.

Getting Started

Add the requirement to your composer.json file and register it with you Application.

{
    "require" : {
        "bernard/silex" :  "~0.4@dev"
    }
}
<?php

$app = new Silex\Application;
$app->register(new Bernard\Silex\BernardServiceProvider, array(
    'bernard.options' => array(
        'driver' => 'doctrine', // or redis, predis, sqs, iron_mq
        'serializer' => 'symfony', // or jms or simple
    ),
));

After that you have to make a decision about what driver and what kind of Serializer you want to use.

The following serializers are supported:

  • Simple. No dependencies and it is the default.
  • JMS Serializer. Requires a service with id jms_serializer and jms_serializer.builder is present.
  • Symfony Serializer. Requires SerializerServiceProvider is registered before this provider.

The following drivers are supported:

Registering with the ServiceResolver

The ServiceResolver enabled supports service ids. This means they are lazy loaded when they are needed instead of when they are registering.

Register bernard.services with an array of MessageName => ServiceId like so:

<?php

$app['bernard.receivers'] = array(
    'ImportUsers' => 'users_worker',
);

Console

If there is a service named console the consume command will be automatically registred. For advanced usecases see the official documentation on Bernard.

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-07-10