19 declare(strict_types=1);
71 $levels = self::$LOG_LEVELS;
72 $intervals = self::$INTERVALS;
74 return $this->
refinery->custom()->transformation(
static function (
$data) use (
79 return new Setup\NullConfig();
83 if (isset(
$data[
'https']) && is_array(
$data[
'https']) &&
$data[
'https'] !== []) {
87 $deletion_interval =
false;
89 isset(
$data[
'deletion_interval']) &&
90 is_array(
$data[
'deletion_interval']) &&
$data[
'deletion_interval'] !== []
92 $deletion_interval =
true;
96 if (isset(
$data[
'ilias_proxy']) && is_array(
$data[
'ilias_proxy']) &&
$data[
'ilias_proxy'] !== []) {
100 $client_proxy =
false;
101 if (isset(
$data[
'client_proxy']) && is_array(
$data[
'client_proxy']) &&
$data[
'client_proxy'] !== []) {
102 $client_proxy =
true;
105 if (isset(
$data[
'address']) && !is_string(
$data[
'address'])) {
107 '%s is not a valid value for address (must be a string). Please check your config file.',
113 isset(
$data[
'port']) && (
114 !is_numeric(
$data[
'port']) ||
115 ((
int)
$data[
'port'] < self::PORT_MIN || (
int)
$data[
'port'] > self::PORT_MAX)
119 '%s is not a valid value for port (must be between %s and %s). Please check your config file.',
126 if (isset(
$data[
'sub_directory']) && !is_string(
$data[
'sub_directory'])) {
128 '%s is not a valid value for sub_directory (must be a string). Please check your config file.',
129 $data[
'sub_directory'],
133 if (isset(
$data[
'log']) && !is_string(
$data[
'log'])) {
135 '%s is not a valid value for log (must be a string). Please check your config file.',
140 if (isset(
$data[
'error_log']) && !is_string(
$data[
'error_log'])) {
142 '%s is not a valid value for error_log (must be a string). Please check your config file.',
149 !in_array((
string) (
$data[
'log_level'] ??
''), $levels,
true)
152 '%s is not a valid value for log_level (must be one of: %s). Please check your config file.',
153 $data[
'log_level'] ??
'',
154 implode(
', ', $levels)
158 if ($deletion_interval) {
159 if (!in_array(
$data[
'deletion_interval'][
'deletion_unit'] ?? null, $intervals,
true)) {
161 '%s is not a valid value for deletion_unit (must be one of: %s). Please check your config file.',
162 $data[
'deletion_interval'][
'deletion_unit'] ??
'',
163 implode(
', ', $intervals)
167 !isset(
$data[
'deletion_interval'][
'deletion_value']) ||
168 !is_numeric(
$data[
'deletion_interval'][
'deletion_value'])
171 '%s is not a valid value for deletion_value. Please check your config file.',
172 $data[
'deletion_interval'][
'deletion_value'] ??
'' 176 !isset(
$data[
'deletion_interval'][
'deletion_time']) ||
177 !is_string(
$data[
'deletion_interval'][
'deletion_time']) ||
178 !preg_match(
'/([01][0-9]|[2][0-3]):[0-5][0-9]/',
$data[
'deletion_interval'][
'deletion_time'])
181 '%s is not a valid value for deletion_time. Please check your config file.',
182 $data[
'deletion_interval'][
'deletion_time'] ??
'' 188 $data[
'address'] ??
'',
189 (
int) (
$data[
'port'] ?? 0),
190 $data[
'sub_directory'] ??
'',
192 $data[
'https'][
'cert'] ??
'',
193 $data[
'https'][
'key'] ??
'',
194 $data[
'https'][
'dhparam'] ??
'',
196 $data[
'log_level'] ??
'',
197 $data[
'error_log'] ??
'',
199 $data[
'ilias_proxy'][
'ilias_url'] ??
'',
201 $data[
'client_proxy'][
'client_url'] ??
'',
203 $data[
'deletion_interval'][
'deletion_unit'] ??
'',
204 (
int) (
$data[
'deletion_interval'][
'deletion_value'] ?? 0),
205 $data[
'deletion_interval'][
'deletion_time'] ??
'' 214 if ($config === null || $config instanceof Setup\
NullConfig) {
215 return new Setup\Objective\NullObjective();
229 if ($config !== null && !($config instanceof Setup\
NullConfig)) {
238 return new Setup\Objective\NullObjective();
243 return new Setup\ObjectiveCollection(
244 'Component Chatroom',
A objective collection is a objective that is achieved once all subobjectives are achieved...
An objective is a desired state of the system that is supposed to be created by the setup...
__construct(protected Refinery\Factory $refinery)
getUpdateObjective(Setup\Config $config=null)
getStatusObjective(Setup\Metrics\Storage $storage)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getArrayToConfigTransformation()
getConfigInput(Setup\Config $config=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getBuildArtifactObjective()
getInstallObjective(Setup\Config $config=null)
A configuration for the setup.
A configuration with no content.
Refinery Factory $refinery