2017 © Pedro Peláez
 

library chronos

Chronos: An object oriented cron job library

image

helthe/chronos

Chronos: An object oriented cron job library

  • Tuesday, September 16, 2014
  • by carlalexander
  • Repository
  • 1 Watchers
  • 1 Stars
  • 53 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 6 % Grown

The README.md

Chronos Build Status Scrutinizer Quality Score

Chronos provides an object oriented library for managing cron jobs both with crontab and programmatically., (*1)

Installation

Add the following in your componser.json:, (*2)

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

Usage

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., (*3)

Crontab

You can use the library to both deploy cron jobs directly into crontab., (*4)

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

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

$crontab->add($job);

$crontab->update();

CronJobScheduler

You can also programmatically run cron jobs., (*5)

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

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

$scheduler->add($job);

$scheduler->runJobs();

Credits

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., (*6)

The CRON expression parser was initially based on the parser built by Michael Dowling., (*7)

Resources

You can run the unit tests with the following command:, (*8)

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

The Versions

16/09 2014

dev-master

9999999-dev https://helthe.co

Chronos: An object oriented cron job library

  Sources   Download

MIT

The Requires

 

by Carl Alexander

schedule cron crontab cron management scheduling cron job

13/06 2013

1.0.0

1.0.0.0 https://helthe.co

Helthe Chronos: An object oriented cron job library

  Sources   Download

MIT

The Requires

 

by Carl Alexander

schedule cron crontab cron management scheduling cron job