ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLoggingDefinitionProcessor.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected ilDBInterface $db;
24 protected string $component_id;
25
26 public function __construct(ilDBInterface $db)
27 {
28 $this->db = $db;
29 }
30
31 public function purge(): void
32 {
33 }
34
35 public function beginComponent(string $component, string $type): void
36 {
37 $this->component_id = '';
38 }
39
40 public function endComponent(string $component, string $type): void
41 {
42 $this->component_id = '';
43 }
44
45 public function beginTag(string $name, array $attributes): void
46 {
47 if ($name === "module" || $name === "service") {
48 $this->component_id = $attributes["id"] ?? '';
49 return;
50 }
51
52 if ($name !== "logging") {
53 return;
54 }
55
56 if ($this->component_id === '') {
57 throw new \RuntimeException(
58 "Found $name-tag outside of module or service in {$this->component_id}."
59 );
60 }
61 ilLogComponentLevels::updateFromXML($this->component_id);
62 }
63
64 public function endTag(string $name): void
65 {
66 if ($name === "module" || $name === "service") {
67 $this->component_id = '';
68 }
69 }
70}
static updateFromXML($a_component_id)
endComponent(string $component, string $type)
This method is called when parsing of component.xml for the given component ends.
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...
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.