Cron
in package
Methods for initialising, recording the progress of, and finalising and cron scripts
Table of Contents
Properties
- $pdo : mixed
- $stmt_message : mixed
- $job_id : mixed
Methods
- exceptionHandler() : mixed
- Exception and error handling for CRON jobs
- failure() : mixed
- Report that a cron job failed.
- message() : void
- Save and output log message for the currently running cron job
- shutdown() : mixed
- Shutdown function, for catching fatal errors
- start() : mixed
- Called at the beginning of a cron job.
- success() : mixed
- Report the successful completion of the cron job.
Properties
$pdo
protected
static mixed
$pdo
$stmt_message
protected
static mixed
$stmt_message
$job_id
private
static mixed
$job_id
Methods
exceptionHandler()
Exception and error handling for CRON jobs
public
static exceptionHandler(mixed $exception) : mixed
Parameters
- $exception : mixed
failure()
Report that a cron job failed.
public
static failure([mixed $message = '' ]) : mixed
Should be used with a return statement to end the execution of the job.
Parameters
- $message : mixed = ''
message()
Save and output log message for the currently running cron job
public
static message([string $message = '' ]) : void
Parameters
- $message : string = ''
-
The message to log
shutdown()
Shutdown function, for catching fatal errors
public
static shutdown() : mixed
start()
Called at the beginning of a cron job.
public
static start(mixed $job_name) : mixed
Checks for appropriate access permissions. Creates a database record for the logging messages.
Note that this function opens an additional database connection, allowing logging to continue to work even if the main script is using transactions - which it should be.
Parameters
- $job_name : mixed
success()
Report the successful completion of the cron job.
public
static success() : mixed