ILIAS  release_8 Revision v8.24
class.ilWebServicesConfigStoredObjective.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 2020 Daniel Weise <daniel.weise@concepts-and-training.de> Extended GPL, see docs/LICENSE */
6
8
13{
15
16 public function __construct(Setup\Config $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 return $environment;
59 }
60
64 public function isApplicable(Setup\Environment $environment): bool
65 {
66 return true;
67 }
68
69 protected function bool2string(bool $value): string
70 {
71 if ($value) {
72 return "1";
73 }
74 return "0";
75 }
76}
isApplicable(Setup\Environment $environment)
@inheritDoc
A configuration for the setup.
Definition: Config.php:27
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
$factory
Definition: metadata.php:75
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...