ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCronManager.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
15  protected $settings;
16 
20  protected $logger;
21 
28  {
29  $this->settings = $settings;
30  $this->logger = $logger;
31  }
32 
36  public function runActiveJobs()
37  {
38  $this->logger->info("CRON - batch start");
39 
40  $ts = time();
41  $this->settings->set("last_cronjob_start_ts", $ts);
42 
43  $useRelativeDates = ilDatePresentation::useRelativeDates();
45  $this->logger->info(sprintf('Set last datetime to: %s', ilDatePresentation::formatDate(new ilDateTime($ts, IL_CAL_UNIX))));
46  $this->logger->info(sprintf(
47  'Verification of last run datetime (read from database): %s',
49  new ilDateTime(ilSetting::_lookupValue('common', 'last_cronjob_start_ts'), IL_CAL_UNIX)
50  )
51  ));
52  ilDatePresentation::setUseRelativeDates((bool) $useRelativeDates);
53 
54  // ilLink::_getStaticLink() should work in crons
55  if (!defined("ILIAS_HTTP_PATH")) {
56  define("ILIAS_HTTP_PATH", ilUtil::_getHttpPath());
57  }
58 
59  // system
60  foreach (self::getCronJobData(null, false) as $row) {
61  $job = self::getJobInstanceById($row["job_id"]);
62  if ($job) {
63  // #18411 - we are NOT using the initial job data as it might be outdated at this point
64  self::runJob($job);
65  }
66  }
67 
68  // plugins
69  foreach (self::getPluginJobs(true) as $item) {
70  // #18411 - we are NOT using the initial job data as it might be outdated at this point
71  self::runJob($item[0]);
72  }
73 
74  $this->logger->info("CRON - batch end");
75  }
76 
83  public static function runJobManual($a_job_id)
84  {
85  global $DIC;
86 
87  $ilLog = $DIC->logger()->root();
88 
89  $result = false;
90 
91  $ilLog->write("CRON - manual start (" . $a_job_id . ")");
92 
93  $job = self::getJobInstanceById($a_job_id);
94  if ($job) {
95  if ($job->isManuallyExecutable()) {
96  $result = self::runJob($job, null, true);
97  } else {
98  $ilLog->write("CRON - job " . $a_job_id . " is not intended to be executed manually");
99  }
100  } else {
101  $ilLog->write("CRON - job " . $a_job_id . " seems invalid or is inactive");
102  }
103 
104  $ilLog->write("CRON - manual end (" . $a_job_id . ")");
105 
106  return $result;
107  }
108 
117  protected static function runJob(ilCronJob $a_job, array $a_job_data = null, $a_manual = false)
118  {
119  global $DIC;
120 
121  $ilLog = $DIC->logger()->root();
122  $ilDB = $DIC->database();
123 
124  $did_run = false;
125 
126  include_once "Services/Cron/classes/class.ilCronJobResult.php";
127 
128  if ($a_job_data === null) {
129  // aquire "fresh" job (status) data
130  $jobData = self::getCronJobData($a_job->getId());
131  $a_job_data = array_pop($jobData);
132  }
133 
134  // already running?
135  if ($a_job_data["alive_ts"]) {
136  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " still running");
137 
138  $cut = 60 * 60 * 3; // 3h
139 
140  // is running (and has not pinged) for 3 hours straight, we assume it crashed
141  if (time() - $a_job_data["alive_ts"] > $cut) {
142  $ilDB->manipulate("UPDATE cron_job SET" .
143  " running_ts = " . $ilDB->quote(0, "integer") .
144  " , alive_ts = " . $ilDB->quote(0, "integer") .
145  " WHERE job_id = " . $ilDB->quote($a_job_data["job_id"], "text"));
146 
147  self::deactivateJob($a_job); // #13082
148 
149  $result = new ilCronJobResult();
152  $result->setMessage("Cron job deactivated because it has been inactive for 3 hours");
153 
154  if (!$a_manual) {
155  self::sendNotification($a_job, $result);
156  }
157 
158  self::updateJobResult($a_job, $result, $a_manual);
159 
160  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " deactivated (assumed crash)");
161  }
162  }
163  // initiate run?
164  elseif ($a_job->isActive(
165  $a_job_data["job_result_ts"],
166  $a_job_data["schedule_type"],
167  $a_job_data["schedule_value"],
168  $a_manual
169  )) {
170  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " started");
171 
172  $ilDB->manipulate("UPDATE cron_job SET" .
173  " running_ts = " . $ilDB->quote(time(), "integer") .
174  " , alive_ts = " . $ilDB->quote(time(), "integer") .
175  " WHERE job_id = " . $ilDB->quote($a_job_data["job_id"], "text"));
176 
177  $ts_in = self::getMicrotime();
178  try {
179  $result = $a_job->run();
180  } catch (\Exception $e) {
181  $result = new \ilCronJobResult();
183  $result->setMessage(sprintf("Exception: %s", $e->getMessage()));
184 
185  $ilLog->error($e->getMessage());
186  $ilLog->error($e->getTraceAsString());
187  } catch (\Throwable $e) { // Could be appended to the catch block with a | in PHP 7.1
188  $result = new \ilCronJobResult();
190  $result->setMessage(sprintf("Exception: %s", $e->getMessage()));
191 
192  $ilLog->error($e->getMessage());
193  $ilLog->error($e->getTraceAsString());
194  }
195  $ts_dur = self::getMicrotime() - $ts_in;
196 
197  // no proper result
198  if (!$result instanceof ilCronJobResult) {
199  $result = new ilCronJobResult();
202  $result->setMessage("Cron job did not return a proper result");
203 
204  if (!$a_manual) {
205  self::sendNotification($a_job, $result);
206  }
207 
208  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " no result");
209  }
210  // no valid configuration, job won't work
211  elseif ($result->getStatus() == ilCronJobResult::STATUS_INVALID_CONFIGURATION) {
212  self::deactivateJob($a_job);
213 
214  if (!$a_manual) {
215  self::sendNotification($a_job, $result);
216  }
217 
218  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " invalid configuration");
219  }
220  // success!
221  else {
222  $did_run = true;
223  }
224 
225  $result->setDuration($ts_dur);
226 
227  self::updateJobResult($a_job, $result, $a_manual);
228 
229  $ilDB->manipulate("UPDATE cron_job SET" .
230  " running_ts = " . $ilDB->quote(0, "integer") .
231  " , alive_ts = " . $ilDB->quote(0, "integer") .
232  " WHERE job_id = " . $ilDB->quote($a_job_data["job_id"], "text"));
233 
234  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " finished");
235  } else {
236  $ilLog->write("CRON - job " . $a_job_data["job_id"] . " returned status inactive");
237  }
238 
239  return $did_run;
240  }
241 
248  public static function getJobInstanceById($a_job_id)
249  {
250  global $DIC;
251 
252  $ilLog = $DIC->logger()->root();
253  $ilPluginAdmin = $DIC['ilPluginAdmin'];
254 
255  // plugin
256  if (substr($a_job_id, 0, 4) == "pl__") {
257  $parts = explode("__", $a_job_id);
258  $pl_name = $parts[1];
259  $job_id = $parts[2];
260  if ($ilPluginAdmin->isActive(IL_COMP_SERVICE, "Cron", "crnhk", $pl_name)) {
261  $plugin_obj = $ilPluginAdmin->getPluginObject(
263  "Cron",
264  "crnhk",
265  $pl_name
266  );
267  $job = $plugin_obj->getCronJobInstance($job_id);
268  if ($job instanceof ilCronJob) {
269  // should never happen but who knows...
270  if (!sizeof(ilCronManager::getCronJobData($job_id))) {
271  // as job is not "imported" from xml
273  }
274  return $job;
275  }
276  }
277 
278  return null;
279  }
280  // system
281  else {
282  $job_data = self::getCronJobData($a_job_id);
283  $job_data = array_pop($job_data);
284  if ($job_data["job_id"] == $a_job_id) {
285  return self::getJobInstance(
286  $job_data["job_id"],
287  $job_data["component"],
288  $job_data["class"],
289  $job_data["path"]
290  );
291  }
292  }
293 
294  $ilLog->write("CRON - job " . $a_job_id . " seems invalid or is inactive");
295  }
296 
305  public static function getJobInstance($a_id, $a_component, $a_class, $a_path = null)
306  {
307  global $DIC;
308 
309  $ilLog = $DIC->logger()->root();
310 
311  if (!$a_path) {
312  $a_path = $a_component . "/classes/";
313  }
314  $class_file = $a_path . "class." . $a_class . ".php";
315  if (file_exists($class_file)) {
316  include_once $class_file;
317  if (class_exists($a_class)) {
318  $refl = new \ReflectionClass($a_class);
319  $job = $refl->newInstanceWithoutConstructor();
320  if ($refl->isSubclassOf(\ilCronJob::class)) {
321  if (0 === strlen($job->getId()) || !isset($_SERVER['PHP_SELF']) || basename($_SERVER['PHP_SELF']) !== 'setup.php') {
322  $job = new $a_class;
323  }
324 
325  if ($job->getId() === $a_id) {
326  return $job;
327  } else {
328  $mess .= " - job id mismatch";
329  }
330  } else {
331  $mess .= " - does not extend ilCronJob";
332  }
333  } else {
334  $mess = "- class not found in file";
335  }
336  } else {
337  $mess = " - class file not found";
338  }
339 
340  $ilLog->write("Cron XML - Job " . $a_id . " in class " . $a_class . " (" .
341  $class_file . ") is invalid." . $mess);
342  }
343 
350  protected static function sendNotification(ilCronJob $a_job, $a_message)
351  {
352  // :TODO:
353  }
354 
355  public static function createDefaultEntry(ilCronJob $a_job, $a_component, $a_class, $a_path)
356  {
357  global $DIC;
358 
359  $ilLog = $DIC->logger()->root();
360  $ilDB = $DIC->database();
361 
362  if (!isset($DIC["ilSetting"])) {
363  $DIC["ilSetting"] = function ($c) {
364  return new ilSetting();
365  };
366  }
367 
368  $ilSetting = $DIC->settings();
369 
370  // already exists?
371  $sql = "SELECT job_id, schedule_type, component, class, path FROM cron_job" .
372  " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text");
373  $set = $ilDB->query($sql);
374  $row = $ilDB->fetchAssoc($set);
375  $job_id = $row['job_id'] ?? null;
376  $job_exists = ($job_id == $a_job->getId());
377  $schedule_type = $row["schedule_type"] ?? null;
378 
379  if ($job_exists && (
380  $row['component'] != $a_component ||
381  $row['class'] != $a_class ||
382  $row['path'] != $a_path
383  )) {
384  $ilDB->manipulateF(
385  'UPDATE cron_job SET component = %s, class = %s, path = %s WHERE job_id = %s',
386  ['text', 'text', 'text', 'text'],
387  [$a_component, $a_class, $a_path, $a_job->getId()]
388  );
389  }
390 
391  // new job
392  if (!$job_exists) {
393  $sql = "INSERT INTO cron_job (job_id, component, class, path)" .
394  " VALUES (" . $ilDB->quote($a_job->getId(), "text") . ", " .
395  $ilDB->quote($a_component, "text") . ", " .
396  $ilDB->quote($a_class, "text") . ", " .
397  $ilDB->quote($a_path, "text") . ")";
398  $ilDB->manipulate($sql);
399 
400  $ilLog->write("Cron XML - Job " . $a_job->getId() . " in class " . $a_class .
401  " added.");
402 
403  // only if flexible
404  self::updateJobSchedule(
405  $a_job,
406  $a_job->getDefaultScheduleType(),
407  $a_job->getDefaultScheduleValue()
408  );
409 
410  // #12221
411  if (!is_object($ilSetting)) {
412  include_once "Services/Administration/classes/class.ilSetting.php";
413  $ilSetting = new ilSetting();
414  }
415 
416  if ($a_job->hasAutoActivation()) {
417  self::activateJob($a_job);
418  } else {
419  // to overwrite dependent settings
420  $a_job->activationWasToggled(false);
421  }
422  }
423  // existing job - but schedule is flexible now
424  elseif ($a_job->hasFlexibleSchedule() && !$schedule_type) {
425  self::updateJobSchedule(
426  $a_job,
427  $a_job->getDefaultScheduleType(),
428  $a_job->getDefaultScheduleValue()
429  );
430  }
431  // existing job - but schedule is static now
432  elseif (!$a_job->hasFlexibleSchedule() && $schedule_type) {
433  self::updateJobSchedule($a_job, null, null);
434  }
435  }
436 
445  public static function updateFromXML($a_component, $a_id, $a_class, $a_path = null)
446  {
447  global $DIC;
448 
449  $ilDB = $DIC->database();
450 
451  if (!$ilDB->tableExists("cron_job")) {
452  return;
453  }
454 
455  // only if job seems valid
456  $job = self::getJobInstance($a_id, $a_component, $a_class, $a_path);
457  if ($job) {
458  self::createDefaultEntry($job, $a_component, $a_class, $a_path);
459  }
460  }
461 
468  public static function clearFromXML($a_component, array $a_xml_job_ids)
469  {
470  global $DIC;
471 
472  $ilDB = $DIC->database();
473  $ilLog = $DIC->logger()->root();
474 
475  if (!$ilDB->tableExists("cron_job")) {
476  return;
477  }
478 
479  // gather existing jobs
480  $all_jobs = array();
481  $sql = "SELECT job_id FROM cron_job" .
482  " WHERE component = " . $ilDB->quote($a_component, "text");
483  $set = $ilDB->query($sql);
484  while ($row = $ilDB->fetchAssoc($set)) {
485  $all_jobs[] = $row["job_id"];
486  }
487 
488  if (sizeof($all_jobs)) {
489  if (sizeof($a_xml_job_ids)) {
490  // delete obsolete job data
491  foreach ($all_jobs as $job_id) {
492  if (!in_array($job_id, $a_xml_job_ids)) {
493  $ilDB->manipulate("DELETE FROM cron_job" .
494  " WHERE component = " . $ilDB->quote($a_component, "text") .
495  " AND job_id = " . $ilDB->quote($job_id, "text"));
496 
497  $ilLog->write("Cron XML - Job " . $job_id . " in class " . $a_component .
498  " deleted.");
499  }
500  }
501  } else {
502  $ilDB->manipulate("DELETE FROM cron_job" .
503  " WHERE component = " . $ilDB->quote($a_component, "text"));
504 
505  $ilLog->write("Cron XML - All jobs deleted for " . $a_component . " as component is inactive.");
506  }
507  }
508  }
509 
510  public static function getPluginJobs($a_only_active = false)
511  {
512  global $DIC;
513 
514  $ilPluginAdmin = $DIC['ilPluginAdmin'];
515 
516  $res = array();
517 
518  foreach ($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Cron", "crnhk") as $pl_name) {
519  $plugin_obj = $ilPluginAdmin->getPluginObject(IL_COMP_SERVICE, "Cron", "crnhk", $pl_name);
520 
521  foreach ((array) $plugin_obj->getCronJobInstances() as $job) {
522  $jobData = ilCronManager::getCronJobData($job->getId());
523  $item = array_pop($jobData);
524  if (!is_array($item) || 0 === count($item)) {
525  // as job is not "imported" from xml
527  }
528 
529  $jobData = ilCronManager::getCronJobData($job->getId());
530  $item = array_pop($jobData);
531 
532  // #17941
533  if (!$a_only_active ||
534  $item["job_status"] == 1) {
535  $res[$job->getId()] = array($job, $item);
536  }
537  }
538  }
539 
540  return $res;
541  }
542 
550  public static function getCronJobData($a_id = null, $a_include_inactive = true)
551  {
552  global $DIC;
553  $ilDB = $DIC->database();
554 
555  $res = array();
556 
557  if ($a_id && !is_array($a_id)) {
558  $a_id = array($a_id);
559  }
560 
561  $sql = "SELECT * FROM cron_job";
562 
563  $where = array();
564  if ($a_id) {
565  $where[] = $ilDB->in("job_id", $a_id, "", "text");
566  } else {
567  $where[] = "class <> " . $ilDB->quote(IL_COMP_PLUGIN, "text");
568  }
569  if (!$a_include_inactive) {
570  $where[] = "job_status = " . $ilDB->quote(1, "integer");
571  }
572  if (sizeof($where)) {
573  $sql .= " WHERE " . implode(" AND ", $where);
574  }
575 
576  // :TODO: discuss job execution order
577  $sql .= " ORDER BY job_id";
578 
579  $set = $ilDB->query($sql);
580  while ($row = $ilDB->fetchAssoc($set)) {
581  $res[] = $row;
582  }
583 
584  return $res;
585  }
586 
592  public static function resetJob(ilCronJob $a_job)
593  {
594  global $DIC;
595  $ilDB = $DIC->database();
596 
597  include_once "Services/Cron/classes/class.ilCronJobResult.php";
598  $result = new ilCronJobResult();
601  $result->setMessage("Cron job re-activated by admin");
602  self::updateJobResult($a_job, $result, true);
603 
604  $ilDB->manipulate("UPDATE cron_job" .
605  " SET running_ts = " . $ilDB->quote(0, "integer") .
606  " , alive_ts = " . $ilDB->quote(0, "integer") .
607  " , job_result_ts = " . $ilDB->quote(0, "integer") .
608  " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text"));
609 
610  self::activateJob($a_job, true);
611  }
612 
619  public static function activateJob(ilCronJob $a_job, $a_manual = false)
620  {
621  global $DIC;
622  $ilDB = $DIC->database();
623 
624  $user_id = 0;
625  if ($DIC->isDependencyAvailable('user')) {
626  $user = $DIC->user();
627  $user_id = $a_manual ? $user->getId() : 0;
628  }
629 
630  $sql = "UPDATE cron_job SET " .
631  " job_status = " . $ilDB->quote(1, "integer") .
632  " , job_status_user_id = " . $ilDB->quote($user_id, "integer") .
633  " , job_status_type = " . $ilDB->quote($a_manual, "integer") .
634  " , job_status_ts = " . $ilDB->quote(time(), "integer") .
635  " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text");
636  $ilDB->manipulate($sql);
637 
638  $a_job->activationWasToggled(true);
639  }
640 
647  public static function deactivateJob(ilCronJob $a_job, $a_manual = false)
648  {
649  global $DIC;
650  $ilDB = $DIC->database();
651  $ilUser = $DIC->user();
652 
653  $user_id = $a_manual ? $ilUser->getId() : 0;
654 
655  $sql = "UPDATE cron_job SET " .
656  " job_status = " . $ilDB->quote(0, "integer") .
657  " , job_status_user_id = " . $ilDB->quote($user_id, "integer") .
658  " , job_status_type = " . $ilDB->quote($a_manual, "integer") .
659  " , job_status_ts = " . $ilDB->quote(time(), "integer") .
660  " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text");
661  $ilDB->manipulate($sql);
662 
663  $a_job->activationWasToggled(false);
664  }
665 
672  public static function isJobActive($a_job_id)
673  {
674  $job = self::getCronJobData($a_job_id);
675  if ((bool) $job[0]["job_status"]) {
676  return true;
677  }
678  return false;
679  }
680 
687  public static function isJobInactive($a_job_id)
688  {
689  $job = self::getCronJobData($a_job_id);
690  if (!(bool) $job[0]["job_status"]) {
691  return true;
692  }
693  return false;
694  }
695 
703  protected static function updateJobResult(ilCronJob $a_job, ilCronJobResult $a_result, $a_manual = false)
704  {
705  global $DIC;
706  $ilDB = $DIC->database();
707  $ilUser = $DIC->user();
708 
709  $user_id = $a_manual ? $ilUser->getId() : 0;
710 
711  $sql = "UPDATE cron_job SET " .
712  " job_result_status = " . $ilDB->quote($a_result->getStatus(), "integer") .
713  " , job_result_user_id = " . $ilDB->quote($user_id, "integer") .
714  " , job_result_code = " . $ilDB->quote($a_result->getCode(), "text") .
715  " , job_result_message = " . $ilDB->quote($a_result->getMessage(), "text") .
716  " , job_result_type = " . $ilDB->quote($a_manual, "integer") .
717  " , job_result_ts = " . $ilDB->quote(time(), "integer") .
718  " , job_result_dur = " . $ilDB->quote($a_result->getDuration() * 1000, "integer") .
719  " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text");
720  $ilDB->manipulate($sql);
721  }
722 
730  public static function updateJobSchedule(ilCronJob $a_job, $a_schedule_type, $a_schedule_value)
731  {
732  global $DIC;
733  $ilDB = $DIC->database();
734 
735  if ($a_schedule_type === null ||
736  ($a_job->hasFlexibleSchedule() &&
737  in_array($a_schedule_type, $a_job->getValidScheduleTypes()))) {
738  $sql = "UPDATE cron_job SET " .
739  " schedule_type = " . $ilDB->quote($a_schedule_type, "integer") .
740  " , schedule_value = " . $ilDB->quote($a_schedule_value, "integer") .
741  " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text");
742  $ilDB->manipulate($sql);
743  }
744  }
745 
751  protected static function getMicrotime()
752  {
753  list($usec, $sec) = explode(" ", microtime());
754  return ((float) $usec + (float) $sec);
755  }
756 
762  public static function ping($a_job_id)
763  {
764  global $DIC;
765  $ilDB = $DIC->database();
766 
767  $ilDB->manipulate("UPDATE cron_job SET " .
768  " alive_ts = " . $ilDB->quote(time(), "integer") .
769  " WHERE job_id = " . $ilDB->quote($a_job_id, "text"));
770  }
771 }
static getJobInstance($a_id, $a_component, $a_class, $a_path=null)
Get job instance (by job data)
run()
Run job.
static updateFromXML($a_component, $a_id, $a_class, $a_path=null)
Process data from module.xml/service.xml.
settings()
Definition: settings.php:2
static sendNotification(ilCronJob $a_job, $a_message)
Send notification to admin about job event(s)
getValidScheduleTypes()
Returns a collection of all valid schedule types for a specific job.
$c
Definition: cli.php:37
$result
runActiveJobs()
Run all active jobs.
getId()
Get id.
Cron job application base class.
static deactivateJob(ilCronJob $a_job, $a_manual=false)
Deactivate cron job.
static runJob(ilCronJob $a_job, array $a_job_data=null, $a_manual=false)
Run single cron job (internal)
const IL_COMP_PLUGIN
static activateJob(ilCronJob $a_job, $a_manual=false)
Activate cron job.
static isJobInactive($a_job_id)
Check if given job is currently inactive.
static setUseRelativeDates($a_status)
set use relative dates
static runJobManual($a_job_id)
Run single job manually.
activationWasToggled($a_currently_active)
Cron job status was changed.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static useRelativeDates()
check if relative dates are used
static resetJob(ilCronJob $a_job)
Reset job.
static _lookupValue($a_module, $a_keyword)
Cron management.
static getCronJobData($a_id=null, $a_include_inactive=true)
Get cron job configuration/execution data.
foreach($_POST as $key=> $value) $res
static getJobInstanceById($a_job_id)
Get job instance (by job id)
hasFlexibleSchedule()
Can the schedule be configured?
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
global $DIC
Definition: goto.php:24
static createDefaultEntry(ilCronJob $a_job, $a_component, $a_class, $a_path)
isActive($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
Is job currently active?
static updateJobResult(ilCronJob $a_job, ilCronJobResult $a_result, $a_manual=false)
Save job result.
getDefaultScheduleType()
Get schedule type.
static _getHttpPath()
static ping($a_job_id)
Keep cron job alive.
global $ilSetting
Definition: privfeed.php:17
static getPluginJobs($a_only_active=false)
static getMicrotime()
Get current microtime.
static clearFromXML($a_component, array $a_xml_job_ids)
Clear job data.
global $ilDB
getDefaultScheduleValue()
Get schedule value.
__construct(\ilSetting $settings, \ilLogger $logger)
ilCronManager constructor.
Class ilStrictCliCronManager.
static updateJobSchedule(ilCronJob $a_job, $a_schedule_type, $a_schedule_value)
Update job schedule.
Cron job result data container.
Component logger with individual log levels by component id.
$ilUser
Definition: imgupload.php:18
static isJobActive($a_job_id)
Check if given job is currently active.
hasAutoActivation()
Is to be activated on "installation".
const IL_COMP_SERVICE