|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * This file is part of ILIAS, a powerful learning management system |
| 5 | + * published by ILIAS open source e-Learning e.V. |
| 6 | + * |
| 7 | + * ILIAS is licensed with the GPL-3.0, |
| 8 | + * see https://www.gnu.org/licenses/gpl-3.0.en.html |
| 9 | + * You should have received a copy of said license along with the |
| 10 | + * source code, too. |
| 11 | + * |
| 12 | + * If this is not the case or you just want to try ILIAS, you'll find |
| 13 | + * us at: |
| 14 | + * https://www.ilias.de |
| 15 | + * https://github.com/ILIAS-eLearning |
| 16 | + * |
| 17 | + *********************************************************************/ |
| 18 | + |
| 19 | +declare(strict_types=1); |
| 20 | + |
| 21 | +namespace ILIAS\WebServices\Setup; |
| 22 | + |
| 23 | +use ILIAS\Setup; |
| 24 | + |
| 25 | +class WebServicesMetricsCollectedObjective extends Setup\Metrics\CollectedObjective |
| 26 | +{ |
| 27 | + protected function getTentativePreconditions(Setup\Environment $environment): array |
| 28 | + { |
| 29 | + return [ |
| 30 | + new \ilSettingsFactoryExistsObjective() |
| 31 | + ]; |
| 32 | + } |
| 33 | + |
| 34 | + protected function collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage): void |
| 35 | + { |
| 36 | + $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY); |
| 37 | + $settings = $factory->settingsFor('common'); |
| 38 | + |
| 39 | + $is_soap_enabled = (bool) $settings->get('soap_user_administration', '0'); |
| 40 | + $storage->storeConfigBool( |
| 41 | + 'soap_user_administration', |
| 42 | + $is_soap_enabled, |
| 43 | + 'SOAP user administration enabled.' |
| 44 | + ); |
| 45 | + |
| 46 | + if ($is_soap_enabled) { |
| 47 | + $storage->storeConfigText( |
| 48 | + 'soap_wsdl_path', |
| 49 | + $settings->get('soap_wsdl_path', ''), |
| 50 | + 'Path to SOAP WSDL file.' |
| 51 | + ); |
| 52 | + |
| 53 | + $storage->storeConfigText( |
| 54 | + 'soap_connect_timeout', |
| 55 | + $settings->get('soap_connect_timeout', ''), |
| 56 | + 'SOAP connection timeout in seconds.' |
| 57 | + ); |
| 58 | + |
| 59 | + $storage->storeConfigText( |
| 60 | + 'soap_response_timeout', |
| 61 | + $settings->get('soap_response_timeout', ''), |
| 62 | + 'SOAP response timeout in seconds.' |
| 63 | + ); |
| 64 | + |
| 65 | + $storage->storeConfigText( |
| 66 | + 'soap_internal_wsdl_path', |
| 67 | + $settings->get('soap_internal_wsdl_path', ''), |
| 68 | + 'Path to internal SOAP WSDL file.' |
| 69 | + ); |
| 70 | + |
| 71 | + $storage->storeConfigBool( |
| 72 | + 'soap_internal_wsdl_verify_peer', |
| 73 | + (bool) $settings->get('soap_internal_wsdl_verify_peer', '1'), |
| 74 | + 'Verify SSL peer for internal WSDL.' |
| 75 | + ); |
| 76 | + |
| 77 | + $storage->storeConfigBool( |
| 78 | + 'soap_internal_wsdl_verify_peer_name', |
| 79 | + (bool) $settings->get('soap_internal_wsdl_verify_peer_name', '1'), |
| 80 | + 'Verify SSL peer name for internal WSDL.' |
| 81 | + ); |
| 82 | + |
| 83 | + $storage->storeConfigBool( |
| 84 | + 'soap_internal_wsdl_allow_self_signed', |
| 85 | + (bool) $settings->get('soap_internal_wsdl_allow_self_signed', '0'), |
| 86 | + 'Allow self-signed certificates for internal WSDL.' |
| 87 | + ); |
| 88 | + } |
| 89 | + |
| 90 | + $storage->storeConfigText( |
| 91 | + 'rpc_server_host', |
| 92 | + $settings->get('rpc_server_host', ''), |
| 93 | + 'RPC server host address.' |
| 94 | + ); |
| 95 | + |
| 96 | + $storage->storeConfigText( |
| 97 | + 'rpc_server_port', |
| 98 | + $settings->get('rpc_server_port', ''), |
| 99 | + 'RPC server port.' |
| 100 | + ); |
| 101 | + } |
| 102 | +} |
0 commit comments