ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Setup\DefinitionProcessor Class Reference
+ Inheritance diagram for ILIAS\Setup\DefinitionProcessor:
+ Collaboration diagram for ILIAS\Setup\DefinitionProcessor:

Public Member Functions

 __construct (private readonly \ilDBInterface $db, \ilSetting $setting, \ilComponentRepository $component_repository, \ilComponentFactory $component_factory)
 
 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

readonly JobRepository $job_repository
 
string $component = null
 
array $has_cron
 

Detailed Description

Definition at line 26 of file DefinitionProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\DefinitionProcessor::__construct ( private readonly \ilDBInterface  $db,
\ilSetting  $setting,
\ilComponentRepository  $component_repository,
\ilComponentFactory  $component_factory 
)

Definition at line 33 of file DefinitionProcessor.php.

38  {
39  $this->has_cron = [];
40 
41  $this->job_repository = new JobRepositoryImpl(
42  $this->db,
43  $setting,
44  new \ILIAS\components\Logging\NullLogger(),
45  $component_repository,
46  $component_factory
47  );
48  }
Interface Observer Contains several chained tasks and infos about them.
ilSetting $setting
Definition: class.ilias.php:68
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Member Function Documentation

◆ beginComponent()

ILIAS\Setup\DefinitionProcessor::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 54 of file DefinitionProcessor.php.

References ILIAS\Setup\DefinitionProcessor\$component.

54  : void
55  {
56  $this->component = $type . '/' . $component;
57  $this->has_cron = [];
58  }

◆ beginTag()

ILIAS\Setup\DefinitionProcessor::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 66 of file DefinitionProcessor.php.

References ILIAS\Setup\DefinitionProcessor\$component, and null.

66  : 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(
78  $component,
79  $attributes['id'],
80  $attributes['class'],
81  ($attributes['path'] ?? null)
82  );
83 
84  $this->has_cron[] = $attributes['id'];
85  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ endComponent()

ILIAS\Setup\DefinitionProcessor::endComponent ( string  $component,
string  $type 
)

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

Implements ilComponentDefinitionProcessor.

Definition at line 60 of file DefinitionProcessor.php.

References null.

60  : void
61  {
62  $this->component = null;
63  $this->has_cron = [];
64  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ endTag()

ILIAS\Setup\DefinitionProcessor::endTag ( string  $name)

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

Implements ilComponentDefinitionProcessor.

Definition at line 87 of file DefinitionProcessor.php.

87  : void
88  {
89  if ($name !== 'module' && $name !== 'service') {
90  return;
91  }
92 
93  $this->job_repository->unregisterJob($this->component, $this->has_cron);
94  }

◆ purge()

ILIAS\Setup\DefinitionProcessor::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 50 of file DefinitionProcessor.php.

50  : void
51  {
52  }

Field Documentation

◆ $component

string ILIAS\Setup\DefinitionProcessor::$component = null
private

◆ $has_cron

array ILIAS\Setup\DefinitionProcessor::$has_cron
private

Definition at line 31 of file DefinitionProcessor.php.

◆ $job_repository

readonly JobRepository ILIAS\Setup\DefinitionProcessor::$job_repository
private

Definition at line 28 of file DefinitionProcessor.php.


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