PHPackages                             abacaphiliac/events-capable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. abacaphiliac/events-capable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

abacaphiliac/events-capable
===========================

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

0.2.1(10y ago)215.3k↓42.1%MITPHP

Since Dec 28Pushed 10y ago2 watchersCompare

[ Source](https://github.com/abacaphiliac/events-capable)[ Packagist](https://packagist.org/packages/abacaphiliac/events-capable)[ RSS](/packages/abacaphiliac-events-capable/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0b7fceeec62f0c390b9f8bf3c063f922a088dd257f133936bf459685c0307953/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61626163617068696c6961632f6576656e74732d63617061626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/abacaphiliac/events-capable/?branch=develop)[![Code Coverage](https://camo.githubusercontent.com/50b501e92bb78f181e4148e6f2de136cdb1882ad1ac2fe55df6d89e2ffcca1a0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61626163617068696c6961632f6576656e74732d63617061626c652f6261646765732f636f7665726167652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/abacaphiliac/events-capable/?branch=develop)[![Build Status](https://camo.githubusercontent.com/0b341a709c3485a0649f7215e1685e68caa4623234887de8410834153088a69c/68747470733a2f2f7472617669732d63692e6f72672f61626163617068696c6961632f6576656e74732d63617061626c652e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/abacaphiliac/events-capable)

abacaphiliac/events-capable
===========================

[](#abacaphiliacevents-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
------------

[](#installation)

Install the latest version with

```
composer require abacaphiliac/events-capable
```

Basic Usage (Configuration)
---------------------------

[](#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
----------------------

[](#configuration-examples)

### Update service\_manager config:

[](#update-service_manager-config)

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

### Update abacaphiliac/events-capable config:

[](#update-abacaphiliacevents-capable-config)

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

Contributing
------------

[](#contributing)

```
composer install && vendor/bin/phing

```

This library attempts to comply with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Total

3

Last Release

3689d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29004cd917fdd7e4a8cc4ddba16f0bbcd90829513c57fc96e3b4f3fcb53f7ead?d=identicon)[abacaphiliac](/maintainers/abacaphiliac)

---

Top Contributors

[![abacaphiliac](https://avatars.githubusercontent.com/u/1656273?v=4)](https://github.com/abacaphiliac "abacaphiliac (20 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/abacaphiliac-events-capable/health.svg)

```
[![Health](https://phpackages.com/badges/abacaphiliac-events-capable/health.svg)](https://phpackages.com/packages/abacaphiliac-events-capable)
```

###  Alternatives

[zf-commons/zfc-base

A set of genetic (abstract) classes which are commonly used across multiple modules.

1441.1M25](/packages/zf-commons-zfc-base)[snapshotpl/zf-snap-geoip

MaxMind GeoIP Module for Zend Framework 2

1512.9k](/packages/snapshotpl-zf-snap-geoip)[bitweb/zf2-cron-module

BitWeb ZF2 module for cron.

1341.6k](/packages/bitweb-zf2-cron-module)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
