ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSystemCheckDefinitionProcessor.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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 }
purge()
This methods is supposed to purge existing data in the provider of the component, so new components c...
$attributes
Definition: metadata.php:248
static getInstanceByGroupId(int $a_group_id)
An ilComponentDefinitionProcessor processes some attributes from a component.xml (i.e.
endTag(string $name)
This is called when a tag ends in the context of the given component.
endComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component ends. ...
$type
if($format !==null) $name
Definition: metadata.php:247
static getInstance()
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...