SproutCMS

This is the code documentation for the SproutCMS project

class Cron

Methods for initialising, recording the progress of, and finalising and cron scripts

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2024-11-25
**/
class NewClassName extends Cron {
    
    /**
    * Called at the beginning of a cron job.
    * 
    * 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.
    **/
    public function start ($job_name) {
        // Method code goes here
    }
    
    /**
    * Save and output log message for the currently running cron job
    **/
    public function message (string $message) {
        // Method code goes here
    }
    
    /**
    * Report that a cron job failed.
    * Should be used with a return statement to end the execution of the job.
    **/
    public function failure ($message) {
        // Method code goes here
    }
    
    /**
    * Report the successful completion of the cron job.
    **/
    public function success () {
        // Method code goes here
    }
    
    /**
    * Exception and error handling for CRON jobs
    **/
    public function exceptionHandler ($exception) {
        // Method code goes here
    }
    
    /**
    * Shutdown function, for catching fatal errors
    **/
    public function shutdown () {
        // Method code goes here
    }
    
}
?>