dev-master
9999999-devEventEmitter is a very simple event dispatching library for PHP
MIT
The Requires
- php >=5.6.0
The Development Requires
by Igor Wiedler
event-dispatcher event-emitter
EventEmitter is a very simple event dispatching library for PHP
EventEmitter is a very simple event dispatching library for PHP. It is a fork of ĂvĂ©nement aiming to provide additional functionality and PHP 5.6 features like variadic arguments., (*1)
It is very strongly inspired by the EventEmitter API found in node.js., (*2)
The recommended way to install EventEmitter is through composer., (*4)
Just create a composer.json file for your project:, (*5)
{ "require": { "peridot/event-emitter": "2.0.*" } }
And run these two commands to install it:, (*6)
$ curl -s http://getcomposer.org/installer | php $ php composer.phar install
Now you can add the autoloader, and you will have access to the library:, (*7)
<?php require 'vendor/autoload.php';
<?php $emitter = new Peridot\EventEmitter();
<?php $emitter->on('user.created', function (User $user) use ($logger) { $logger->log(sprintf("User '%s' was created.", $user->getLogin())); });
<?php $emitter->emit('user.created', $user);
$ vendor/bin/phpunit
MIT, see LICENSE., (*8)
EventEmitter is a very simple event dispatching library for PHP
MIT
event-dispatcher event-emitter