ILIAS  release_8 Revision v8.24
class.ilCronDefinitionProcessor.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use Monolog\Logger;
22
24{
27 private ?string $component = null;
29 private array $has_cron;
30
31 public function __construct(
33 ilSetting $setting,
34 ilComponentRepository $componentRepository,
35 ilComponentFactory $componentFactory
36 ) {
37 $this->db = $db;
38 $this->has_cron = [];
39
40 $this->cronRepository = new ilCronJobRepositoryImpl(
41 $this->db,
42 $setting,
43 new class () extends ilLogger {
44 public function __construct()
45 {
46 }
47
48 public function isHandling(int $a_level): bool
49 {
50 return false;
51 }
52
53 public function log(string $a_message, int $a_level = ilLogLevel::INFO): void
54 {
55 }
56
57 public function dump($a_variable, int $a_level = ilLogLevel::INFO): void
58 {
59 }
60
61 public function debug(string $a_message, array $a_context = []): void
62 {
63 }
64
65 public function info(string $a_message): void
66 {
67 }
68
69 public function notice(string $a_message): void
70 {
71 }
72
73 public function warning(string $a_message): void
74 {
75 }
76
77 public function error(string $a_message): void
78 {
79 }
80
81 public function critical(string $a_message): void
82 {
83 }
84
85 public function alert(string $a_message): void
86 {
87 }
88
89 public function emergency(string $a_message): void
90 {
91 }
92
94 public function getLogger(): Logger
95 {
96 }
97
98 public function write(string $a_message, $a_level = ilLogLevel::INFO): void
99 {
100 }
101
102 public function writeLanguageLog(string $a_topic, string $a_lang_key): void
103 {
104 }
105
106 public function logStack(?int $a_level = null, string $a_message = ''): void
107 {
108 }
109
110 public function writeMemoryPeakUsage(int $a_level): void
111 {
112 }
113 },
114 $componentRepository,
115 $componentFactory
116 );
117 }
118
119 public function purge(): void
120 {
121 }
122
123 public function beginComponent(string $component, string $type): void
124 {
125 $this->component = $type . "/" . $component;
126 $this->has_cron = [];
127 }
128
129 public function endComponent(string $component, string $type): void
130 {
131 $this->component = null;
132 $this->has_cron = [];
133 }
134
135 public function beginTag(string $name, array $attributes): void
136 {
137 if ($name !== "cron") {
138 return;
139 }
140
141 $component = $attributes["component"] ?? null;
142 if (!$component) {
144 }
145
146 $this->cronRepository->registerJob(
148 $attributes["id"],
149 $attributes["class"],
150 ($attributes["path"] ?? null)
151 );
152
153 $this->has_cron[] = $attributes["id"];
154 }
155
156 public function endTag(string $name): void
157 {
158 if ($name !== "module" && $name !== "service") {
159 return;
160 }
161
162 $this->cronRepository->unregisterJob($this->component, $this->has_cron);
163 }
164}
error(string $a_errmsg)
endTag(string $name)
This is called when a tag ends in the context of the given component.
purge()
This methods is supposed to purge existing data in the provider of the component, so new components c...
endComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component ends.
__construct(ilDBInterface $db, ilSetting $setting, ilComponentRepository $componentRepository, ilComponentFactory $componentFactory)
beginTag(string $name, array $attributes)
This is called when a tag starts in the context of the given component.
beginComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component starts.
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An ilComponentDefinitionProcessor processes some attributes from a component.xml (i....
Readable part of repository interface to ilComponentDataDB.
Interface ilDBInterface.
if($format !==null) $name
Definition: metadata.php:247
$attributes
Definition: metadata.php:248
$type