35 : void
36 {
37 $db = $environment->getResource(
Setup\Environment::RESOURCE_DATABASE);
38
39
40
41
42
44 $GLOBALS[
'DIC'] =
new DI\Container();
47
49 $chatAdministration = current($chatAdministrations);
50
52 $settings = $chat_admin->loadGeneralSettings();
53
54 if (count($settings) > 0) {
55 $storage->storeConfigText(
56 'address',
57 $settings['address'] ?? '',
58 'IP-Address/FQN of Chat Server.'
59 );
60 $storage->storeConfigText(
61 'port',
62 (string) ($settings['port'] ?? ''),
63 'Port of the chat server.'
64 );
65 $storage->storeConfigText(
66 'sub_directory',
67 $settings['sub_directory'] ?? '',
68 'http(s)://[IP/Domain]/[SUB_DIRECTORY]'
69 );
70
71 $storage->storeConfigText(
72 'protocol',
73 $settings['protocol'] ?? '',
74 'Protocol used for connection (http/https).'
75 );
76
77 if (isset($settings['protocol']) && $settings['protocol'] === 'https') {
78 $cert = new Setup\Metrics\Metric(
79 Setup\Metrics\Metric::STABILITY_CONFIG,
80 Setup\Metrics\Metric::TYPE_TEXT,
81 $settings['cert'] ?? ''
82 );
83 $key = new Setup\Metrics\Metric(
84 Setup\Metrics\Metric::STABILITY_CONFIG,
85 Setup\Metrics\Metric::TYPE_TEXT,
86 $settings['key'] ?? ''
87 );
88 $dhparam = new Setup\Metrics\Metric(
89 Setup\Metrics\Metric::STABILITY_CONFIG,
90 Setup\Metrics\Metric::TYPE_TEXT,
91 $settings['dhparam'] ?? ''
92 );
93 $https = new Setup\Metrics\Metric(
94 Setup\Metrics\Metric::STABILITY_CONFIG,
95 Setup\Metrics\Metric::TYPE_COLLECTION,
96 [
97 'cert' => $cert,
98 'key' => $key,
99 'dhparam' => $dhparam,
100 ],
101 'Holds parameters for https.'
102 );
103 $storage->store('https', $https);
104 }
105
106 $storage->storeConfigText(
107 'log',
108 (string) ($settings['log'] ?? ''),
109 "Absolute server path to the chat server's log file."
110 );
111 $storage->storeConfigText(
112 'log_level',
113 $settings['log_level'] ?? '',
114 'Possible values are emerg, alert, crit error, warning, notice, info, debug, silly.'
115 );
116 $storage->storeConfigText(
117 'error_log',
118 $settings['error_log'] ?? '',
119 "Absolute server path to the chat server's error log file."
120 );
121
122 if (isset($settings['ilias_proxy']) && $settings['ilias_proxy']) {
123 $ilias_url = new Setup\Metrics\Metric(
124 Setup\Metrics\Metric::STABILITY_CONFIG,
125 Setup\Metrics\Metric::TYPE_TEXT,
126 $settings['ilias_url'] ?? ''
127 );
128 $ilias_proxy = new Setup\Metrics\Metric(
129 Setup\Metrics\Metric::STABILITY_CONFIG,
130 Setup\Metrics\Metric::TYPE_COLLECTION,
131 [
132 'ilias_url' => $ilias_url
133 ],
134 'Holds proxy url if ILIAS proxy is enabled.'
135 );
136 $storage->store('ilias_proxy', $ilias_proxy);
137 } else {
138 $storage->storeConfigBool(
139 'ilias_proxy',
140 false,
141 'Holds proxy url if ILIAS proxy is enabled.'
142 );
143 }
144
145 if (isset($settings['client_proxy']) && $settings['client_proxy']) {
146 $client_url = new Setup\Metrics\Metric(
147 Setup\Metrics\Metric::STABILITY_CONFIG,
148 Setup\Metrics\Metric::TYPE_TEXT,
149 $settings['client_url'] ?? ''
150 );
151 $client_proxy = new Setup\Metrics\Metric(
152 Setup\Metrics\Metric::STABILITY_CONFIG,
153 Setup\Metrics\Metric::TYPE_COLLECTION,
154 [
155 'client_url' => $client_url
156 ],
157 'Holds proxy url if client proxy is enabled.'
158 );
159 $storage->store('client_proxy', $client_proxy);
160 } else {
161 $storage->storeConfigBool(
162 'client_proxy',
163 false,
164 'Holds proxy url if client proxy is enabled.'
165 );
166 }
167
168 if (isset($settings['deletion_mode']) && $settings['deletion_mode']) {
169 $deletion_unit = new Setup\Metrics\Metric(
170 Setup\Metrics\Metric::STABILITY_CONFIG,
171 Setup\Metrics\Metric::TYPE_TEXT,
172 $settings['deletion_unit'] ?? ''
173 );
174 $deletion_value = new Setup\Metrics\Metric(
175 Setup\Metrics\Metric::STABILITY_CONFIG,
176 Setup\Metrics\Metric::TYPE_TEXT,
177 (string) ($settings['deletion_value'] ?? '')
178 );
179 $deletion_time = new Setup\Metrics\Metric(
180 Setup\Metrics\Metric::STABILITY_CONFIG,
181 Setup\Metrics\Metric::TYPE_TEXT,
182 $settings['deletion_time'] ?? ''
183 );
184 $deletion_mode = new Setup\Metrics\Metric(
185 Setup\Metrics\Metric::STABILITY_CONFIG,
186 Setup\Metrics\Metric::TYPE_COLLECTION,
187 [
188 'deletion_unit' => $deletion_unit,
189 'deletion_value' => $deletion_value,
190 'deletion_time' => $deletion_time,
191 ],
192 'Holds information about deletion process.'
193 );
194 $storage->store(
195 'deletion_mode',
196 $deletion_mode
197 );
198 }
199 }
200
202 }
static _getObjectsByType(string $obj_type="", ?int $owner=null)