A text, audio and video chat application built with webRTC and Ratchet (PHP WebSocket)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Amir 04459364f0 Files Created 9 years ago
..
src/Evenement Files Created 9 years ago
tests Files Created 9 years ago
.gitignore Files Created 9 years ago
.travis.yml Files Created 9 years ago
CHANGELOG.md Files Created 9 years ago
LICENSE Files Created 9 years ago
README.md Files Created 9 years ago
composer.json Files Created 9 years ago
phpunit.xml.dist Files Created 9 years ago

README.md

Événement

Événement is a very simple event dispatching library for PHP.

It has the same design goals as Silex and Pimple, to empower the user while staying concise and simple.

It is very strongly inspired by the EventEmitter API found in node.js.

Build Status

Fetch

The recommended way to install Événement is through composer.

Just create a composer.json file for your project:

{
    "require": {
        "evenement/evenement": "2.0.*"
    }
}

Note: The 2.0.* version of Événement requires PHP 5.4. If you are using PHP 5.3, please use the 1.0.* version:

{
    "require": {
        "evenement/evenement": "1.0.*"
    }
}

And run these two commands to install it:

$ 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:

<?php
require 'vendor/autoload.php';

Usage

Creating an Emitter

<?php
$emitter = new Evenement\EventEmitter();

Adding Listeners

<?php
$emitter->on('user.created', function (User $user) use ($logger) {
    $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
});

Emitting Events

<?php
$emitter->emit('user.created', array($user));

Tests

$ phpunit

License

MIT, see LICENSE.