2017 © Pedro Peláez
 

library autocrontabjob

An object-oriented approach to scheduling regular cron jobs automatically

image

battis/autocrontabjob

An object-oriented approach to scheduling regular cron jobs automatically

  • Friday, March 17, 2017
  • by battis
  • Repository
  • 3 Watchers
  • 0 Stars
  • 54 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

AutoCrontabJob

Latest Version Scrutinizer Code Quality, (*1)

An object-oriented approach to scheduling regular cron jobs automatically, (*2)

Install

Include in your composer.json:, (*3)

"require": {
  "battis/autocrontabjob": "~1.0"
}

Use

This object requires a bit of prior preparation before use:, (*4)

  1. Extend the abstract Battis\AutoCrontabJob class and implement the abstract scheduledJob() method.
  2. Create a script that will be run regularly as a Cron job, that instantiates your class and calls its scheduledJob() method.

Gotcha warning: Remember that, when a script is run by cron, it is not run by Apache, so it will not generate output to the Apache log files. Handily, there is a log built-in that you can use (see below). By default, the log will be generated in the same directory as the script and be similarly named (.log instead of .php)., (*5)

A sample script file (which is an all-in-one, also extending the abstract class), called MyJob.php:, (*6)

log->log('I did something!');
    }
}

// instantiate our class
$job = new MyJob(
    'example',
    __FILE__, // *this* file will be called by crontab
    '*/5 * * * *' // run every five minutes (woo hoo!)
);

// fire the scheduledJob() method
$job->scheduledJob();

?>

The Versions

17/03 2017

dev-master

9999999-dev

An object-oriented approach to scheduling regular cron jobs automatically

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

17/03 2017

dev-develop

dev-develop

An object-oriented approach to scheduling regular cron jobs automatically

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

17/03 2017

v1.0.1

1.0.1.0

An object-oriented approach to scheduling regular cron jobs automatically

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis

11/08 2015

v1.0

1.0.0.0

An object-oriented approach to scheduling regular cron jobs automatically

  Sources   Download

LGPL-3.0

The Requires

 

by Seth Battis