ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilLoggingSetupAgent.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 use ILIAS\Setup;
27 use ILIAS\UI;
28 
29 class ilLoggingSetupAgent implements Setup\Agent
30 {
32 
33  protected Factory $refinery;
34 
35  public function __construct(Factory $refinery)
36  {
37  $this->refinery = $refinery;
38  }
39 
43  public function hasConfig(): bool
44  {
45  return true;
46  }
47 
52  {
53  return $this->refinery->custom()->transformation(function ($data) {
54  return new \ilLoggingSetupConfig(
55  $data["enable"] ?? false,
56  $data["path_to_logfile"] ?? null,
57  $data["errorlog_dir"] ?? null
58  );
59  });
60  }
61 
65  public function getInstallObjective(Config $config = null): Objective
66  {
67  return new ilLoggingConfigStoredObjective($config);
68  }
69 
73  public function getUpdateObjective(Config $config = null): Objective
74  {
75  $objective = new Setup\Objective\NullObjective();
76  if ($config !== null) {
77  $objective = new ilLoggingConfigStoredObjective($config);
78  }
80  'Update of Services/Logging',
81  false,
82  $objective,
85  )
86  );
87  }
88 
93  {
94  return new Setup\Objective\NullObjective();
95  }
96 
100  public function getStatusObjective(Storage $storage): Objective
101  {
102  return new Setup\ObjectiveCollection(
103  'Component Logging',
104  true,
107  );
108  }
109 
113  public function getMigrations(): array
114  {
115  return [];
116  }
117 }
An objective is a desired state of the system that is supposed to be created by the setup...
Definition: Objective.php:30
getUpdateObjective(Config $config=null)
__construct(Factory $refinery)
getStatusObjective(Storage $storage)
getInstallObjective(Config $config=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A transformation is a function from one datatype to another.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A configuration for the setup.
Definition: Config.php:26