ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHttpSetupAgent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Setup;
23
25{
26 use Setup\Agent\HasNoNamedObjective;
27
28 protected \ILIAS\Refinery\Factory $refinery;
29
30 public function __construct(
32 ) {
33 $this->refinery = $refinery;
34 }
35
39 public function hasConfig(): bool
40 {
41 return true;
42 }
43
48 {
49 return $this->refinery->custom()->transformation(function ($data): \ilHttpSetupConfig {
50 return new \ilHttpSetupConfig(
51 $data["path"],
52 isset($data["https_autodetection"]) && $data["https_autodetection"],
53 isset($data["forced"]) && $data["forced"],
54 (isset($data["https_autodetection"]) && $data["https_autodetection"])
55 ? $data["https_autodetection"]["header_name"]
56 : null,
57 (isset($data["https_autodetection"]) && $data["https_autodetection"])
58 ? $data["https_autodetection"]["header_value"]
59 : null,
60 isset($data["proxy"]) && $data["proxy"],
61 (isset($data["proxy"]) && $data["proxy"])
62 ? $data["proxy"]["host"]
63 : null,
64 (isset($data["proxy"]) && $data["proxy"])
65 ? $data["proxy"]["port"]
66 : null,
67 $data['allowed_hosts'] ?? null
68 );
69 });
70 }
71
75 public function getInstallObjective(?Setup\Config $config = null): Setup\Objective
76 {
77 $http_config_stored = new ilHttpConfigStoredObjective($config);
78
79 if (!$config->isProxyEnabled()) {
80 return $http_config_stored;
81 }
82
84 $http_config_stored,
85 new ProxyConnectableCondition($config)
86 );
87 }
88
92 public function getUpdateObjective(?Setup\Config $config = null): Setup\Objective
93 {
94 if ($config !== null) {
95 return new ilHttpConfigStoredObjective($config);
96 }
98 }
99
104 {
106 }
107
111 public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
112 {
113 return new ilHttpMetricsCollectedObjective($storage);
114 }
115
119 public function getMigrations(): array
120 {
121 return [];
122 }
123}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
A non-objective, nothing to do to achieve it...
A wrapper around an objective that adds some preconditions.
getStatusObjective(Setup\Metrics\Storage $storage)
getUpdateObjective(?Setup\Config $config=null)
getInstallObjective(?Setup\Config $config=null)
__construct(Refinery\Factory $refinery)
ILIAS Refinery Factory $refinery
A transformation is a function from one datatype to another.
A agent is some component that performs part of the setup process.
Definition: Agent.php:30
A configuration for the setup.
Definition: Config.php:27
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
Storage is simple key/value store without further schema definition.
Definition: Storage.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...