19declare(strict_types=1);
28 use Setup\Agent\HasNoNamedObjective;
65 throw new LogicException(
"Not yet implemented.");
73 return $this->
refinery->custom()->transformation(
static function (
$data) use (
82 if (isset(
$data[
'https']) && is_array(
$data[
'https']) &&
$data[
'https'] !== []) {
86 $deletion_interval =
false;
88 isset(
$data[
'deletion_interval']) &&
89 is_array(
$data[
'deletion_interval']) &&
$data[
'deletion_interval'] !== []
91 $deletion_interval =
true;
95 if (isset(
$data[
'ilias_proxy']) && is_array(
$data[
'ilias_proxy']) &&
$data[
'ilias_proxy'] !== []) {
99 $client_proxy =
false;
100 if (isset(
$data[
'client_proxy']) && is_array(
$data[
'client_proxy']) &&
$data[
'client_proxy'] !== []) {
101 $client_proxy =
true;
104 if (isset(
$data[
'address']) && !is_string(
$data[
'address'])) {
105 throw new InvalidArgumentException(sprintf(
106 '%s is not a valid value for address (must be a string). Please check your config file.',
112 isset(
$data[
'port']) && (
113 !is_numeric(
$data[
'port']) ||
114 ((
int)
$data[
'port'] < self::PORT_MIN || (
int)
$data[
'port'] > self::PORT_MAX)
117 throw new InvalidArgumentException(sprintf(
118 '%s is not a valid value for port (must be between %s and %s). Please check your config file.',
125 if (isset(
$data[
'sub_directory']) && !is_string(
$data[
'sub_directory'])) {
126 throw new InvalidArgumentException(sprintf(
127 '%s is not a valid value for sub_directory (must be a string). Please check your config file.',
128 $data[
'sub_directory'],
132 if (isset(
$data[
'log']) && !is_string(
$data[
'log'])) {
133 throw new InvalidArgumentException(sprintf(
134 '%s is not a valid value for log (must be a string). Please check your config file.',
139 if (isset(
$data[
'error_log']) && !is_string(
$data[
'error_log'])) {
140 throw new InvalidArgumentException(sprintf(
141 '%s is not a valid value for error_log (must be a string). Please check your config file.',
148 !in_array((
string) (
$data[
'log_level'] ??
''), $levels,
true)
150 throw new InvalidArgumentException(sprintf(
151 '%s is not a valid value for log_level (must be one of: %s). Please check your config file.',
152 $data[
'log_level'] ??
'',
153 implode(
', ', $levels)
157 if ($deletion_interval) {
158 if (!in_array(
$data[
'deletion_interval'][
'deletion_unit'] ??
null, $intervals,
true)) {
159 throw new InvalidArgumentException(sprintf(
160 '%s is not a valid value for deletion_unit (must be one of: %s). Please check your config file.',
161 $data[
'deletion_interval'][
'deletion_unit'] ??
'',
162 implode(
', ', $intervals)
166 !isset(
$data[
'deletion_interval'][
'deletion_value']) ||
167 !is_numeric(
$data[
'deletion_interval'][
'deletion_value'])
169 throw new InvalidArgumentException(sprintf(
170 '%s is not a valid value for deletion_value. Please check your config file.',
171 $data[
'deletion_interval'][
'deletion_value'] ??
''
175 !isset(
$data[
'deletion_interval'][
'deletion_time']) ||
176 !is_string(
$data[
'deletion_interval'][
'deletion_time']) ||
177 !preg_match(
'/([01][0-9]|[2][0-3]):[0-5][0-9]/',
$data[
'deletion_interval'][
'deletion_time'])
179 throw new InvalidArgumentException(sprintf(
180 '%s is not a valid value for deletion_time. Please check your config file.',
181 $data[
'deletion_interval'][
'deletion_time'] ??
''
187 $data[
'address'] ??
'',
188 (
int) (
$data[
'port'] ?? 0),
189 $data[
'sub_directory'] ??
'',
191 $data[
'https'][
'cert'] ??
'',
192 $data[
'https'][
'key'] ??
'',
193 $data[
'https'][
'dhparam'] ??
'',
195 $data[
'log_level'] ??
'',
196 $data[
'error_log'] ??
'',
198 $data[
'ilias_proxy'][
'ilias_url'] ??
'',
200 $data[
'client_proxy'][
'client_url'] ??
'',
202 $data[
'deletion_interval'][
'deletion_unit'] ??
'',
203 (
int) (
$data[
'deletion_interval'][
'deletion_value'] ?? 0),
204 $data[
'deletion_interval'][
'deletion_time'] ??
''
243 'Component Chatroom',
Builds a Color from either hex- or rgb values.
A configuration with no content.
A objective collection is a objective that is achieved once all subobjectives are achieved.
A non-objective, nothing to do to achieve it...
getArrayToConfigTransformation()
getConfigInput(?Setup\Config $config=null)
getStatusObjective(Setup\Metrics\Storage $storage)
getUpdateObjective(?Setup\Config $config=null)
getInstallObjective(?Setup\Config $config=null)
__construct(protected Refinery\Factory $refinery)
This class attempt to achieve a set of database update steps.
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.
Storage is simple key/value store without further schema definition.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...