Download the PHP package daltonmenezes/eventscheduler without Composer
On this page you can find all versions of the php package daltonmenezes/eventscheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daltonmenezes/eventscheduler
More information about daltonmenezes/eventscheduler
Files in daltonmenezes/eventscheduler
Package eventscheduler
Short Description A simple event scheduler application for PHP projects
License MIT
Homepage https://github.com/daltonmenezes/eventScheduler
Informations about the package eventscheduler
eventScheduler
A simple event scheduler application for PHP projects.
Installation
The Package is available on Packagist, you can install it using Composer.
Dependencies
- PHP 5.3+
How it works?
Setting a start and finish date, you can trigger different events for each.
The behavior you set to be triggered on the start date is defined by after() event;
The behavior you set to be triggered while the start date is not reached is the before() event;
When the finish date is reached, after() event is suspended, as well before() event too.
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.
Usage
Instantiate EventScheduler\EventScheduler.
Define a start date in your schedule, its must be an array.
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.
Now, call the schedule method for set your array.
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.
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.
Call the run() method for when all is done!
Nothing more! It's simple! ;) You can read or test the example.php file at the root directory of this project.
Problems or suggestions?
Open a Issue. :)