19declare(strict_types=1);
27 use Setup\Agent\HasNoNamedObjective;
73 throw new LogicException(
"Not yet implemented.");
84 return $this->
refinery->custom()->transformation(
static function (
$data) use (
93 if (isset(
$data[
'https']) && is_array(
$data[
'https']) &&
$data[
'https'] !== []) {
97 $deletion_interval =
false;
99 isset(
$data[
'deletion_interval']) &&
100 is_array(
$data[
'deletion_interval']) &&
$data[
'deletion_interval'] !== []
102 $deletion_interval =
true;
105 $ilias_proxy =
false;
106 if (isset(
$data[
'ilias_proxy']) && is_array(
$data[
'ilias_proxy']) &&
$data[
'ilias_proxy'] !== []) {
110 $client_proxy =
false;
111 if (isset(
$data[
'client_proxy']) && is_array(
$data[
'client_proxy']) &&
$data[
'client_proxy'] !== []) {
112 $client_proxy =
true;
115 if (isset(
$data[
'address']) && !is_string(
$data[
'address'])) {
116 throw new InvalidArgumentException(sprintf(
117 '%s is not a valid value for address (must be a string). Please check your config file.',
123 isset(
$data[
'port']) && (
124 !is_numeric(
$data[
'port']) ||
125 ((
int)
$data[
'port'] < self::PORT_MIN || (
int)
$data[
'port'] > self::PORT_MAX)
128 throw new InvalidArgumentException(sprintf(
129 '%s is not a valid value for port (must be between %s and %s). Please check your config file.',
136 if (isset(
$data[
'sub_directory']) && !is_string(
$data[
'sub_directory'])) {
137 throw new InvalidArgumentException(sprintf(
138 '%s is not a valid value for sub_directory (must be a string). Please check your config file.',
139 $data[
'sub_directory'],
143 if (isset(
$data[
'log']) && !is_string(
$data[
'log'])) {
144 throw new InvalidArgumentException(sprintf(
145 '%s is not a valid value for log (must be a string). Please check your config file.',
150 if (isset(
$data[
'error_log']) && !is_string(
$data[
'error_log'])) {
151 throw new InvalidArgumentException(sprintf(
152 '%s is not a valid value for error_log (must be a string). Please check your config file.',
159 !in_array((
string) (
$data[
'log_level'] ??
''), $levels,
true)
161 throw new InvalidArgumentException(sprintf(
162 '%s is not a valid value for log_level (must be one of: %s). Please check your config file.',
163 $data[
'log_level'] ??
'',
164 implode(
', ', $levels)
168 if ($deletion_interval) {
169 if (!in_array(
$data[
'deletion_interval'][
'deletion_unit'] ??
null, $intervals,
true)) {
170 throw new InvalidArgumentException(sprintf(
171 '%s is not a valid value for deletion_unit (must be one of: %s). Please check your config file.',
172 $data[
'deletion_interval'][
'deletion_unit'] ??
'',
173 implode(
', ', $intervals)
177 !isset(
$data[
'deletion_interval'][
'deletion_value']) ||
178 !is_numeric(
$data[
'deletion_interval'][
'deletion_value'])
180 throw new InvalidArgumentException(sprintf(
181 '%s is not a valid value for deletion_value. Please check your config file.',
182 $data[
'deletion_interval'][
'deletion_value'] ??
''
186 !isset(
$data[
'deletion_interval'][
'deletion_time']) ||
187 !is_string(
$data[
'deletion_interval'][
'deletion_time']) ||
188 !preg_match(
'/([01][0-9]|[2][0-3]):[0-5][0-9]/',
$data[
'deletion_interval'][
'deletion_time'])
190 throw new InvalidArgumentException(sprintf(
191 '%s is not a valid value for deletion_time. Please check your config file.',
192 $data[
'deletion_interval'][
'deletion_time'] ??
''
198 $data[
'address'] ??
'',
199 (
int) (
$data[
'port'] ?? 0),
200 $data[
'sub_directory'] ??
'',
202 $data[
'https'][
'cert'] ??
'',
203 $data[
'https'][
'key'] ??
'',
204 $data[
'https'][
'dhparam'] ??
'',
206 $data[
'log_level'] ??
'',
207 $data[
'error_log'] ??
'',
209 $data[
'ilias_proxy'][
'ilias_url'] ??
'',
211 $data[
'client_proxy'][
'client_url'] ??
'',
213 $data[
'deletion_interval'][
'deletion_unit'] ??
'',
214 (
int) (
$data[
'deletion_interval'][
'deletion_value'] ?? 0),
215 $data[
'deletion_interval'][
'deletion_time'] ??
''
A configuration with no content.
A non-objective, nothing to do to achieve it...
Store information about https is enabled.
getArrayToConfigTransformation()
getInstallObjective(Setup\Config $config=null)
getUpdateObjective(Setup\Config $config=null)
getStatusObjective(Setup\Metrics\Storage $storage)
getBuildArtifactObjective()
__construct(Refinery\Factory $refinery)
Refinery Factory $refinery
getConfigInput(Setup\Config $config=null)
getMigrations()
@inheritDoc
A agent is some component that performs part of the setup process.
A configuration for the setup.
An objective is a desired state of the system that is supposed to be created by the setup.
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...
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...