2017 © Pedro Peláez
 

library eventscheduler

A simple event scheduler application for PHP projects

image

daltonmenezes/eventscheduler

A simple event scheduler application for PHP projects

  • Saturday, May 7, 2016
  • by daltonmenezes
  • Repository
  • 2 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

eventScheduler

become a patron or sponsor Build Status Code Climate, (*1)

A simple event scheduler application for PHP projects., (*2)

Installation

The Package is available on Packagist, you can install it using Composer., (*3)

composer require daltonmenezes/eventscheduler

Dependencies

How it works?

Setting a start and finish date, you can trigger different events for each., (*4)

The behavior you set to be triggered on the start date is defined by after() event;, (*5)

The behavior you set to be triggered while the start date is not reached is the before() event;, (*6)

When the finish date is reached, after() event is suspended, as well before() event too., (*7)

The finish date is optional, if you want the after() event continues in your project execution without date limitations, simply do not set the key "finish" in your array., (*8)

Usage

Instantiate EventScheduler\EventScheduler., (*9)

use EventScheduler\EventScheduler;

$event = new EventScheduler();

Define a start date in your schedule, its must be an array., (*10)

$schedule = array("start" => "18-03-2016 23:43");

The start key is for when your event must be triggered. If you want define a finish date for shutdown it, you must define a finish key in your array., (*11)

$schedule = array(
    "start" => "18-03-2016 23:43",
    "finish" => "20-03-2020 19:13"
);

Now, call the schedule method for set your array., (*12)

$event->schedule($schedule);

Call the before() method for set this behavior. The parameter must be a Closure. If you do not want call and define this method, it's ok. It's optional., (*13)

$event->before(function() {
    // define here whatever you want execute as an expected behavior
});

Call the after() method for set this behavior. The parameter must be a Closure. If you do not want call and define this method, it's ok. It's optional., (*14)

$event->after(function() {
    // define here whatever you want execute as an expected behavior
});

Call the run() method for when all is done!, (*15)

$event->run();

Nothing more! It's simple! ;) You can read or test the example.php file at the root directory of this project., (*16)

Problems or suggestions?

Open a Issue. :), (*17)

The Versions

07/05 2016

dev-master

9999999-dev https://github.com/daltonmenezes/eventScheduler

A simple event scheduler application for PHP projects

  Sources   Download

MIT

The Requires

  • php >=5.2.8

 

The Development Requires

events scheduler cron

29/04 2016

1.0.0

1.0.0.0 https://github.com/daltonmenezes/eventScheduler

A simple event scheduler application for PHP projects

  Sources   Download

MIT

The Requires

  • php >=5.2.8

 

The Development Requires

events scheduler cron