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 ...@@ -61,12 +61,7 @@ if(preg_match('/^\d+\-(.*)$/', $name, $match)) $name = $match[1]; // strip numer
include $path . '/' . $cronjob_file; include $path . '/' . $cronjob_file;
$class_name = 'cronjob_' . $name; $class_name = 'cronjob_' . $name;
$cronjob = new $class_name(); $cronjob = new $class_name();
$cronjob->run(true);
$cronjob->onPrepare();
$cronjob->onBeforeRun();
$cronjob->onRunJob();
$cronjob->onAfterRun();
$cronjob->onCompleted();
die("finished.\n"); die("finished.\n");
......
...@@ -76,14 +76,14 @@ class cronjob { ...@@ -76,14 +76,14 @@ class cronjob {
/** run through cronjob sequence **/ /** run through cronjob sequence **/
public function run() { public function run($debug_mode = false) {
global $conf; global $conf;
if($conf['log_priority'] <= LOGLEVEL_DEBUG) print "Called run() for class " . get_class($this) . "\n"; 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"; if($conf['log_priority'] <= LOGLEVEL_DEBUG) print "Job has schedule: " . $this->getSchedule() . "\n";
$this->onPrepare(); $this->onPrepare();
$run_it = $this->onBeforeRun(); $run_it = $this->onBeforeRun();
if($run_it == true) { if($run_it == true || $debug_mode === true) {
$this->onRunJob(); $this->onRunJob();
$this->onAfterRun(); $this->onAfterRun();
$this->onCompleted(); $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