PHP Classes


Recommend this page to a friend!
  Classes of Michael Cummings   PHP Event Mediator   Download  
Role: Auxiliary data
Content type: text/markdown
Description: Description
Class: PHP Event Mediator
Emit and listen to events using a mediator object
Author: By
Last change: Updated Scrutinizer badge to show score in
Update included and excluded files in .scrutinizer.yml.
Added SensioLabsInsight badge in
Removed unneeded commented out line in PHPSpec example.
Updated labeling of badges in
Updated coveralls badge in
Added some info about new changes to
Date: 7 years ago
Size: 2,607 bytes


Class file image Download


SensioLabsInsight<br/><br/> Travis-ci: Build Status<br/> Scrutinizer-ci: Scrutinizer Code Quality<br/> Coveralls: Coverage Status

A general event mediator (dispatcher) with minimal dependencies so it is easy to drop in and use.


The recommended way to install Event-Mediator is using Composer from Packagist with:

composer require dragonrun1/event-mediator

You can also get it as a zip file from GitHub.


Licensing information can be found in the LICENSE file.


Most people might know event mediator as an event dispatcher instead and both names would have worked. The reason I choose to call it a mediator is it follows the mediator pattern. For those of you that are familiar with Symfony 2 and it's EventDispatcher component then Event Mediator started out as basically a drop in replace for it without the (IMHO) huge dependence overhead often seen with Symfony components. Event Mediator has since grown into something better since then I think.

To get a better understanding about Event-Mediator and how you might use it check out Understanding Event-Mediator


* Started new 2.0-dev branch with many BC breaking changes. * The 1.0 series is now end of life and all application developers should update to newer 2.0 versions ASAP. If your code only used the listener methods the move should be easy with few changes needed. If application uses any of the subscriber stuff you will need to update the returned event array to reflect the new expected format.

For a more complete understand of the changes refer to the commit messages and new code.