2017 © Pedro Peláez
 

library event-observer

Watch events and react to them

image

flamecore/event-observer

Watch events and react to them

  • Friday, October 23, 2015
  • by secondtruth
  • Repository
  • 7 Watchers
  • 3 Stars
  • 7,905 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

FlameCore EventObserver

Latest Stable Build Status Scrutinizer Coverage License, (*1)

This library allows you to watch events and react to them., (*2)

Usage instructions and more information can be found in our Wiki., (*3)

Getting Started

Create a new Responder object which holds the event listeners:, (*4)

$responder = new Responder();
$responder->setListener('action.event', function (array $data, $event) {
    print_r($data);
});

Create a new Observer object and give it some actions to react to:, (*5)

$observer = new Observer();
$observer->addResponder('action', $responder);

Notify the Observer of events (optionally with data):, (*6)

$observer->notify('action.event');
$observer->notify('action.event', ['some_data' => 123.4]);

Installation

Install via Composer

Create a file called composer.json in your project directory and put the following into it:, (*7)

{
    "require": {
        "flamecore/event-observer": "1.0.*"
    }
}

Install Composer if you don't already have it present on your system:, (*8)

$ curl -sS https://getcomposer.org/installer | php

Use Composer to download the vendor libraries and generate the vendor/autoload.php file:, (*9)

$ php composer.phar install

Include the vendor autoloader and use the classes:, (*10)

namespace Acme\MyApplication;

use FlameCore\EventObserver\Observer;
use FlameCore\EventObserver\Responder\Responder;

require_once 'vendor/autoload.php';

Requirements

  • You must have at least PHP version 5.4 installed on your system.

Contributors

If you want to contribute, please see the CONTRIBUTING file first., (*11)

Thanks to the contributors:, (*12)

  • Christian Neff (secondtruth)

The Versions

23/10 2015

1.0.x-dev

1.0.9999999.9999999-dev http://www.flamecore.org

Watch events and react to them

  Sources   Download

ISC

The Requires

  • php >=5.4

 

The Development Requires

events dispatcher mediator

03/08 2015

dev-master

9999999-dev http://www.flamecore.org

Watch events and react to them

  Sources   Download

ISC

The Requires

  • php >=5.4

 

The Development Requires

events dispatcher mediator

03/08 2015

v1.0.0

1.0.0.0 http://www.flamecore.org

Watch events and react to them

  Sources   Download

ISC

The Requires

  • php >=5.4

 

The Development Requires

events dispatcher mediator