ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilWebServicesConfigStoredObjective.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /* Copyright (c) 2020 Daniel Weise <daniel.weise@concepts-and-training.de> Extended GPL, see docs/LICENSE */
6 
7 use ILIAS\Setup;
8 
12 class ilWebServicesConfigStoredObjective implements Setup\Objective
13 {
15 
16  public function __construct(ilWebServicesSetupConfig $config)
17  {
18  $this->config = $config;
19  }
20 
21  public function getHash(): string
22  {
23  return hash("sha256", self::class);
24  }
25 
26  public function getLabel(): string
27  {
28  return "Store information about web services in the settings";
29  }
30 
31  public function isNotable(): bool
32  {
33  return true;
34  }
35 
36  public function getPreconditions(Setup\Environment $environment): array
37  {
38  return [
39  new \ilIniFilesPopulatedObjective(),
40  new \ilSettingsFactoryExistsObjective()
41  ];
42  }
43 
44  public function achieve(Setup\Environment $environment): Setup\Environment
45  {
46  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
47  $settings = $factory->settingsFor("common");
48  $settings->set(
49  "soap_user_administration",
50  $this->bool2string($this->config->isSOAPUserAdministration())
51  );
52  $settings->set("soap_wsdl_path", $this->config->getSOAPWsdlPath());
53  $settings->set("soap_connect_timeout", (string) $this->config->getSOAPConnectTimeout());
54  $settings->set("soap_response_timeout", (string) $this->config->getSoapResponseTimeout());
55  $settings->set("rpc_server_host", $this->config->getRPCServerHost());
56  $settings->set("rpc_server_port", (string) $this->config->getRPCServerPort());
57 
58  $settings->set('soap_internal_wsdl_path', (string) $this->config->getSoapInternalWsdlPath());
59  $settings->set('soap_internal_wsdl_verify_peer', (string) $this->config->getSoapInternalWsdlVerifyPeer());
60  $settings->set('soap_internal_wsdl_verify_peer_name', (string) $this->config->getSoapInternalWsdlVerifyPeerName());
61  $settings->set('soap_internal_wsdl_allow_self_signed', (string) $this->config->getSoapInternalWsdlAllowSelfSigned());
62 
63  return $environment;
64  }
65 
69  public function isApplicable(Setup\Environment $environment): bool
70  {
71  return true;
72  }
73 
74  protected function bool2string(bool $value): string
75  {
76  if ($value) {
77  return "1";
78  }
79  return "0";
80  }
81 }
Store information about https is enabled.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
Definition: Environment.php:27