-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup - remove soap from Admin/Server config and implement it into setup
Setup - remove rpc from Admin/Server config and implement it into setup
- Loading branch information
Showing
6 changed files
with
252 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
{ACTION_BUTTONS} | ||
{SETTINGS_TABLE} |
77 changes: 77 additions & 0 deletions
77
Services/WebServices/classes/Setup/class.ilWebServicesConfigStoredObjective.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/* Copyright (c) 2020 Daniel Weise <[email protected]> Extended GPL, see docs/LICENSE */ | ||
|
||
use ILIAS\Setup; | ||
|
||
/** | ||
* Store information about https is enabled | ||
*/ | ||
class ilWebServicesConfigStoredObjective implements Setup\Objective | ||
{ | ||
/** | ||
* @var \ilWebServicesSetupConfig | ||
*/ | ||
protected $config; | ||
|
||
public function __construct(\ilWebServicesSetupConfig $config) | ||
{ | ||
$this->config = $config; | ||
} | ||
|
||
public function getHash() : string | ||
{ | ||
return hash("sha256", self::class); | ||
} | ||
|
||
public function getLabel() : string | ||
{ | ||
return "Store information about web services in the settings"; | ||
} | ||
|
||
public function isNotable() : bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function getPreconditions(Setup\Environment $environment) : array | ||
{ | ||
$common_config = $environment->getConfigFor("common"); | ||
return [ | ||
new \ilIniFilesPopulatedObjective($common_config), | ||
new \ilSettingsFactoryExistsObjective() | ||
]; | ||
} | ||
|
||
public function achieve(Setup\Environment $environment) : Setup\Environment | ||
{ | ||
$factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY); | ||
$settings = $factory->settingsFor("common"); | ||
$settings->set( | ||
"soap_user_administration", | ||
$this->bool2string($this->config->isSOAPUserAdministration()) | ||
); | ||
$settings->set("soap_wsdl_path", $this->config->getSOAPWsdlPath()); | ||
$settings->set("soap_connect_timeout", (int) $this->config->getSOAPConnectTimeout()); | ||
$settings->set("rpc_server_host", $this->config->getRPCServerHost()); | ||
$settings->set("rpc_server_port", $this->config->getRPCServerPort()); | ||
|
||
return $environment; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function isApplicable(Setup\Environment $environment) : bool | ||
{ | ||
return true; | ||
} | ||
|
||
protected function bool2string(bool $value) : string | ||
{ | ||
if ($value) { | ||
return "1"; | ||
} | ||
return "0"; | ||
} | ||
} |
Oops, something went wrong.