Commit 2e3887d0 authored by Marius Burkard's avatar Marius Burkard
Browse files

- changed the way cron_debug.php calls cron job classes

parent 24b60e9c
......@@ -61,12 +61,7 @@ if(preg_match('/^\d+\-(.*)$/', $name, $match)) $name = $match[1]; // strip numer
include $path . '/' . $cronjob_file;
$class_name = 'cronjob_' . $name;
$cronjob = new $class_name();
$cronjob->onPrepare();
$cronjob->onBeforeRun();
$cronjob->onRunJob();
$cronjob->onAfterRun();
$cronjob->onCompleted();
$cronjob->run(true);
die("finished.\n");
......
......@@ -76,14 +76,14 @@ class cronjob {
/** run through cronjob sequence **/
public function run() {
public function run($debug_mode = false) {
global $conf;
if($conf['log_priority'] <= LOGLEVEL_DEBUG) print "Called run() for class " . get_class($this) . "\n";
if($conf['log_priority'] <= LOGLEVEL_DEBUG) print "Job has schedule: " . $this->getSchedule() . "\n";
$this->onPrepare();
$run_it = $this->onBeforeRun();
if($run_it == true) {
if($run_it == true || $debug_mode === true) {
$this->onRunJob();
$this->onAfterRun();
$this->onCompleted();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment