2017 © Pedro Peláez
 

library phevent

Event package for your app

image

buuum/phevent

Event package for your app

  • Tuesday, March 7, 2017
  • by buuum
  • Repository
  • 2 Watchers
  • 0 Stars
  • 62 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Buuum - Event package for your app

Packagist license, (*1)

Simple and extremely flexible PHP event class

Getting started

You need PHP >= 5.5 to use Buuum., (*2)

Install

System Requirements

You need PHP >= 5.5.0 to use Buuum\Event but the latest stable version of PHP is recommended., (*3)

Composer

Buuum is available on Packagist and can be installed using Composer:, (*4)

composer require buuum/phevent

Manually

You may use your own autoloader as long as it follows PSR-0 or PSR-4 standards. Just put src directory contents in your vendor directory., (*5)

Map your events


use Buuum\Event; $event = Event::getInstance(); $event->loadListeners(include_once __DIR__ . '/listeners.php'); $event->setResolver(new EventResolver());

listeners.php

use Buuum\Event;

return function(Event $event){

    $event->addListener('email.send.confirm', function(string $event_name){
        return $event_name;
    });

    $event->addListener('email.send.susbscribe', function($param1, $param2, string $event_name){
        return $event_name;
    });

    $event->addListener('email.send.rememberme', [App\Example::class, 'sendremember']);
};

Add resolver

$event->setResolver(new EventResolver());

EventResolver.php

use Buuum\Event;
class EventResolver implements EventResolverInterface
{

    public function __construct()
    {
    }

    public function resolve($handler)
    {
        return $handler;
    }
}

Fire events


\\ Static method Event::eventFire($event_name); \\ Method $event->fire($event_name); \\ Add params Event::eventFire($event_name, $param1, $param2); $event->fire($event_name, $param1, $param2);

LICENSE

The MIT License (MIT), (*6)

Copyright (c) 2017 alfonsmartinez, (*7)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*8)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*9)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*10)

The Versions

07/03 2017

dev-master

9999999-dev https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event

07/03 2017

v1.0.2

1.0.2.0 https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event

07/03 2017

v1.0.1

1.0.1.0 https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event

07/03 2017

v1.0.0

1.0.0.0 https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event

28/11 2016

v0.0.3

0.0.3.0 https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event

28/11 2016

v0.0.1

0.0.1.0 https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event

28/11 2016

v0.0.2

0.0.2.0 https://github.com/buuum/phevent

Event package for your app

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Alfons Martinez

events event