You are here

public static function JobScheduler::instance in Job Scheduler 6

Create a single instance of JobScheduler.

1 call to JobScheduler::instance()
job_scheduler in ./job_scheduler.module
Return a JobScheduler object.

File

./JobScheduler.inc, line 15
JobScheduler class.

Class

JobScheduler
Handle adding and removing jobs from schedule.

Code

public static function instance() {
  static $instance;
  if (!isset($instance)) {
    $class = variable_get('job_scheduler_class', 'JobScheduler');

    // We don't manually include files here. Thus if you use a custom class,
    // you need the Autoload module or similar.
    if (class_exists($class, TRUE)) {
      $instance = new $class();
    }
    else {

      // Fallback.
      $instance = new JobScheduler();
    }
  }
  return $instance;
}