ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSystemCheckDefinitionProcessor.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21{
22 protected \ilDBInterface $db;
23 protected ?string $component_id;
24
25 public function __construct(\ilDBInterface $db)
26 {
27 $this->db = $db;
28 }
29
30 public function purge(): void
31 {
32 }
33
34 public function beginComponent(string $component, string $type): void
35 {
36 $this->component_id = null;
37 }
38
39 public function endComponent(string $component, string $type): void
40 {
41 $this->component_id = null;
42 }
43
44 public function beginTag(string $name, array $attributes): void
45 {
46 if ($name === "module" || $name === "service") {
47 $this->component_id = $attributes["id"] ?? null;
48 return;
49 }
50 if ($name !== "systemcheck" || $name !== "systemcheck_task") {
51 return;
52 }
53 if ($this->component_id === null) {
54 throw new \RuntimeException(
55 "Found $name-tag outside of module or service."
56 );
57 }
58
59 if ($name === "systemcheck") {
60 ilSCGroups::getInstance()->updateFromComponentDefinition($this->component_id);
61 }
62 if ($name === "systemcheck_task") {
63 $group_id = ilSCGroups::getInstance()->lookupGroupByComponentId($this->component_id);
64 $tasks = ilSCTasks::getInstanceByGroupId($group_id);
65 $tasks->updateFromComponentDefinition((string) ($attributes['identifier'] ?? ''));
66 }
67 }
68
69 public function endTag(string $name): void
70 {
71 if ($name === "module" || $name === "service") {
72 $this->component_id = null;
73 }
74 }
75}
static getInstance()
static getInstanceByGroupId(int $a_group_id)
beginComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component starts.
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.
endTag(string $name)
This is called when a tag ends in the context of the given component.
beginTag(string $name, array $attributes)
This is called when a tag starts in the context of the given component.
An ilComponentDefinitionProcessor processes some attributes from a component.xml (i....
Interface ilDBInterface.