Chronos: An object oriented cron job library

Installs: 37

Dependents: 1

Watchers: 1

Forks: 1

Language: PHP

1.0.0 2013-06-13 20:30 UTC


Chronos provides an object oriented library for managing cron jobs both with crontab and programmatically.


Add the following in your componser.json:

    "require": {
        "helthe/chronos": "~1.0"


CRON expression

At its core, Chronos uses a CRON expression parser to validate all cron jobs. It supports all the language characteristics defined here as well as the predefined scheduling definitions except @reboot.


You can use the library to both deploy cron jobs directly into crontab.

use Helthe\Component\Chronos\Crontab;
use Helthe\Component\Chronos\Job\CommandJob;

$crontab = new Crontab();
$job = new CommandJob('@hourly', '/usr/bin/my_great_command');




You can also programmatically run cron jobs.

use Helthe\Component\Chronos\CronJobScheduler;
use Helthe\Component\Chronos\Job\CommandJob;

$scheduler = new CronJobScheduler();
$job = new CommandJob('@hourly', '/usr/bin/my_great_command');




Chronos was created to fill the need for managing recurring jobs in PHP. The initial inspiration for it was to have a Whenever equivalent in PHP.

The CRON expression parser was initially based on the parser built by Michael Dowling.


You can run the unit tests with the following command:

$ cd path/to/Helthe/Component/XXX/
$ composer.phar install --dev
$ phpunit