ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilWebServicesConfigStoredObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Setup;
22
27{
29
31 {
32 $this->config = $config;
33 }
34
35 public function getHash(): string
36 {
37 return hash("sha256", self::class);
38 }
39
40 public function getLabel(): string
41 {
42 return "Store information about web services in the settings";
43 }
44
45 public function isNotable(): bool
46 {
47 return true;
48 }
49
50 public function getPreconditions(Setup\Environment $environment): array
51 {
52 return [
53 new \ilIniFilesPopulatedObjective(),
54 new \ilSettingsFactoryExistsObjective()
55 ];
56 }
57
58 public function achieve(Setup\Environment $environment): Setup\Environment
59 {
60 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
61 $settings = $factory->settingsFor("common");
62 $settings->set(
63 "soap_user_administration",
64 $this->bool2string($this->config->isSOAPUserAdministration())
65 );
66 $settings->set("soap_wsdl_path", $this->config->getSOAPWsdlPath());
67 $settings->set("soap_connect_timeout", (string) $this->config->getSOAPConnectTimeout());
68 $settings->set("soap_response_timeout", (string) $this->config->getSoapResponseTimeout());
69 $settings->set("rpc_server_host", $this->config->getRPCServerHost());
70 $settings->set("rpc_server_port", (string) $this->config->getRPCServerPort());
71
72 $settings->set('soap_internal_wsdl_path', (string) $this->config->getSoapInternalWsdlPath());
73 $settings->set('soap_internal_wsdl_verify_peer', (string) $this->config->getSoapInternalWsdlVerifyPeer());
74 $settings->set('soap_internal_wsdl_verify_peer_name', (string) $this->config->getSoapInternalWsdlVerifyPeerName());
75 $settings->set('soap_internal_wsdl_allow_self_signed', (string) $this->config->getSoapInternalWsdlAllowSelfSigned());
76
77 return $environment;
78 }
79
83 public function isApplicable(Setup\Environment $environment): bool
84 {
85 return true;
86 }
87
88 protected function bool2string(bool $value): string
89 {
90 if ($value) {
91 return "1";
92 }
93 return "0";
94 }
95}
isApplicable(Setup\Environment $environment)
@inheritDoc
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...