19 declare(strict_types=1);
70 $levels = self::$LOG_LEVELS;
71 $intervals = self::$INTERVALS;
73 return $this->
refinery->custom()->transformation(
static function (
$data) use (
78 return new Setup\NullConfig();
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'])) {
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)
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'])) {
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'])) {
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'])) {
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)
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)) {
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'])
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'])
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'] ??
'' 214 return new Setup\Objective\NullObjective();
237 return new Setup\Objective\NullObjective();
242 return new Setup\ObjectiveCollection(
243 '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)
hasConfig()
Does this agent require a configuration?
A agent is some component that performs part of the setup process.
getUpdateObjective(?Setup\Config $config=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getInstallObjective(?Setup\Config $config=null)
Storage is simple key/value store without further schema definition.
getStatusObjective(Setup\Metrics\Storage $storage)
getMigrations()
Get a named map of migrations available for this Agent.
getConfigInput(?Setup\Config $config=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getArrayToConfigTransformation()
Agents must be able to tell how to create a configuration from a nested array.
getBuildObjective()
Get the goal the agent wants to achieve to build artifacts.
A configuration for the setup.
A configuration with no content.