ILIAS  release_8 Revision v8.23
ilCronDefinitionProcessor Class Reference
+ Inheritance diagram for ilCronDefinitionProcessor:
+ Collaboration diagram for ilCronDefinitionProcessor:

Public Member Functions

 __construct (ilDBInterface $db, ilSetting $setting, ilComponentRepository $componentRepository, ilComponentFactory $componentFactory)
 
 purge ()
 This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate. More...
 
 beginComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component starts. More...
 
 endComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component ends. More...
 
 beginTag (string $name, array $attributes)
 This is called when a tag starts in the context of the given component. More...
 
 endTag (string $name)
 This is called when a tag ends in the context of the given component. More...
 

Private Attributes

ilDBInterface $db
 
ilCronJobRepository $cronRepository
 
string $component = null
 
array $has_cron
 

Detailed Description

Definition at line 23 of file class.ilCronDefinitionProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilCronDefinitionProcessor::__construct ( ilDBInterface  $db,
ilSetting  $setting,
ilComponentRepository  $componentRepository,
ilComponentFactory  $componentFactory 
)

PhpInconsistentReturnPointsInspection

Definition at line 31 of file class.ilCronDefinitionProcessor.php.

References $db, ILIAS\UI\examples\MessageBox\Info\info(), and ilLogLevel\INFO.

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  }
__construct(ilDBInterface $db, ilSetting $setting, ilComponentRepository $componentRepository, ilComponentFactory $componentFactory)
+ Here is the call graph for this function:

Member Function Documentation

◆ beginComponent()

ilCronDefinitionProcessor::beginComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component starts.

This is supposed to reset any internal parsing state.

Implements ilComponentDefinitionProcessor.

Definition at line 123 of file class.ilCronDefinitionProcessor.php.

References $component.

123  : void
124  {
125  $this->component = $type . "/" . $component;
126  $this->has_cron = [];
127  }
$type

◆ beginTag()

ilCronDefinitionProcessor::beginTag ( string  $name,
array  $attributes 
)

This is called when a tag starts in the context of the given component.

Parameters
string[]$attributes

Implements ilComponentDefinitionProcessor.

Definition at line 135 of file class.ilCronDefinitionProcessor.php.

References $component.

135  : void
136  {
137  if ($name !== "cron") {
138  return;
139  }
140 
141  $component = $attributes["component"] ?? null;
142  if (!$component) {
144  }
145 
146  $this->cronRepository->registerJob(
147  $component,
148  $attributes["id"],
149  $attributes["class"],
150  ($attributes["path"] ?? null)
151  );
152 
153  $this->has_cron[] = $attributes["id"];
154  }
$attributes
Definition: metadata.php:248
if($format !==null) $name
Definition: metadata.php:247

◆ endComponent()

ilCronDefinitionProcessor::endComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component ends.

Implements ilComponentDefinitionProcessor.

Definition at line 129 of file class.ilCronDefinitionProcessor.php.

129  : void
130  {
131  $this->component = null;
132  $this->has_cron = [];
133  }

◆ endTag()

ilCronDefinitionProcessor::endTag ( string  $name)

This is called when a tag ends in the context of the given component.

Implements ilComponentDefinitionProcessor.

Definition at line 156 of file class.ilCronDefinitionProcessor.php.

156  : void
157  {
158  if ($name !== "module" && $name !== "service") {
159  return;
160  }
161 
162  $this->cronRepository->unregisterJob($this->component, $this->has_cron);
163  }
if($format !==null) $name
Definition: metadata.php:247

◆ purge()

ilCronDefinitionProcessor::purge ( )

This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate.

Implements ilComponentDefinitionProcessor.

Definition at line 119 of file class.ilCronDefinitionProcessor.php.

119  : void
120  {
121  }

Field Documentation

◆ $component

string ilCronDefinitionProcessor::$component = null
private

Definition at line 27 of file class.ilCronDefinitionProcessor.php.

Referenced by beginComponent(), and beginTag().

◆ $cronRepository

ilCronJobRepository ilCronDefinitionProcessor::$cronRepository
private

Definition at line 26 of file class.ilCronDefinitionProcessor.php.

◆ $db

ilDBInterface ilCronDefinitionProcessor::$db
private

Definition at line 25 of file class.ilCronDefinitionProcessor.php.

Referenced by __construct().

◆ $has_cron

array ilCronDefinitionProcessor::$has_cron
private

Definition at line 29 of file class.ilCronDefinitionProcessor.php.


The documentation for this class was generated from the following file: