if ($class === 'OC_Cache_FileGlobalGC') {
$class = '\OC\Cache\FileGlobalGC';
}
+ if (class_exists($class)) {
+ // job from disabled app or old version of an app, no need to do anything
+ return null;
+ }
$job = new $class();
$job->setId($row['id']);
$job->setLastRun($row['last_run']);
$class = $argument['klass'];
$method = $argument['method'];
$parameters = $argument['parameters'];
- call_user_func(array($class, $method), $parameters);
+ if (is_callable(array($class, $method))) {
+ call_user_func(array($class, $method), $parameters);
+ }
}
}
class RegularJob extends \OC\BackgroundJob\Job {
public function run($argument) {
- call_user_func($argument);
+ if (is_callable($argument)) {
+ call_user_func($argument);
+ }
}
}