abacaphiliac/events-capable 问题修复 & 功能扩展

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

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

abacaphiliac/events-capable

最新稳定版本:0.2.1

Composer 安装命令:

composer require abacaphiliac/events-capable

包简介

Provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface.

README 文档

README

Scrutinizer Code Quality Code Coverage Build Status

abacaphiliac/events-capable

Tired of writing backwards-compatible logic in all of your factory code to wire up listeners? Is your service implementation registered with Zend's service manager? Then this package might be right for you!

This package provides a config-based initializer that attaches listeners to implementations of \Zend\EventManager\EventsCapableInterface. When the service concrete is instantiated by service manager, it will pass through the initializer provided by this package. If your service is Events Capable, then the initializer will check the config for registered listeners to attach to the service's event manager.

Installation

Install the latest version with

composer require abacaphiliac/events-capable

Basic Usage (Configuration)

  1. Update service_manager config.
    1. Add initializer.
    2. Add listener.
  2. Update abacaphiliac/events-capable config:
    1. Add \Zend\EventManager\EventsCapableInterface implementation.
    2. Add \Zend\EventManager\ListenerAggregateInterface implementation.

Configuration Examples

Update service_manager config:

return [
    'service_manager' => [
        'factories' => [
            \MyListener::class => \MyListenerFactory::class,
        ],
        'initializers' => [
            \abacaphiliac\EventsCapable\EventsCapableInitializer::class,
        ],
    ],
];

Update abacaphiliac/events-capable config:

return [
    'abacaphiliac/events-capable' => [
        'eventsCapable' => [
            \MyEventsCapableService::class => [
                \MyListener::class,
            ],
        ],
    ],
];

Contributing

composer install && vendor/bin/phing

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固