ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DefinitionProcessor.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
27{
29 private ?string $component = null;
31 private array $has_cron;
32
33 public function __construct(
34 private readonly \ilDBInterface $db,
36 \ilComponentRepository $component_repository,
37 \ilComponentFactory $component_factory
38 ) {
39 $this->has_cron = [];
40
41 $this->job_repository = new JobRepositoryImpl(
42 $this->db,
44 new \ILIAS\components\Logging\NullLogger(),
45 $component_repository,
46 $component_factory
47 );
48 }
49
50 public function purge(): void
51 {
52 }
53
54 public function beginComponent(string $component, string $type): void
55 {
56 $this->component = $type . '/' . $component;
57 $this->has_cron = [];
58 }
59
60 public function endComponent(string $component, string $type): void
61 {
62 $this->component = null;
63 $this->has_cron = [];
64 }
65
66 public function beginTag(string $name, array $attributes): void
67 {
68 if ($name !== 'cron') {
69 return;
70 }
71
72 $component = $attributes['component'] ?? null;
73 if (!$component) {
75 }
76
77 $this->job_repository->registerJob(
79 $attributes['id'],
80 $attributes['class'],
81 ($attributes['path'] ?? null)
82 );
83
84 $this->has_cron[] = $attributes['id'];
85 }
86
87 public function endTag(string $name): void
88 {
89 if ($name !== 'module' && $name !== 'service') {
90 return;
91 }
92
93 $this->job_repository->unregisterJob($this->component, $this->has_cron);
94 }
95}
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.
__construct(private readonly \ilDBInterface $db, \ilSetting $setting, \ilComponentRepository $component_repository, \ilComponentFactory $component_factory)
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...
beginTag(string $name, array $attributes)
This is called when a tag starts in the context of the given component.
ilSetting $setting
Definition: class.ilias.php:68
ILIAS Setting Class.
An ilComponentDefinitionProcessor processes some attributes from a component.xml (i....
Readable part of repository interface to ilComponentDataDB.
Interface ilDBInterface.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
Class ilChatroomConfigFileHandler \ILIAS\Chatroom\classes.