ILIAS  release_8 Revision v8.24
ilHttpConfigStoredObjective Class Reference
+ Inheritance diagram for ilHttpConfigStoredObjective:
+ Collaboration diagram for ilHttpConfigStoredObjective:

Public Member Functions

 __construct (\ilHttpSetupConfig $config)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 

Protected Attributes

ilHttpSetupConfig $config
 

Detailed Description

Definition at line 18 of file class.ilHttpConfigStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilHttpConfigStoredObjective::__construct ( \ilHttpSetupConfig  $config)

Definition at line 22 of file class.ilHttpConfigStoredObjective.php.

24 {
25 $this->config = $config;
26 }

References $config.

Member Function Documentation

◆ achieve()

ilHttpConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 54 of file class.ilHttpConfigStoredObjective.php.

54 : Setup\Environment
55 {
56 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
57
58 $ini->setVariable(
61 $this->config->getHttpPath()
62 );
63 $ini->setVariable(
66 $this->config->isForced() ? "1" : "0"
67 );
68 $ini->setVariable(
71 $this->config->isAutodetectionEnabled() ? "1" : "0"
72 );
73 $ini->setVariable(
76 (string) $this->config->getHeaderName()
77 );
78 $ini->setVariable(
81 (string) $this->config->getHeaderValue()
82 );
83
84
85 if (!$ini->write()) {
86 throw new Setup\UnachievableException("Could not write ilias.ini.php");
87 }
88
89 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
90 $settings = $factory->settingsFor("common");
91 $settings->set("proxy_status", (string) $this->config->isProxyEnabled());
92 $settings->set("proxy_host", (string) $this->config->getProxyHost());
93 $settings->set("proxy_port", (string) $this->config->getProxyPort());
94
95 return $environment;
96 }
const SETTINGS_GROUP_SERVER
const SETTING_HTTP_PATH
const SETTINGS_GROUP_HTTPS
const SETTING_AUTO_HTTPS_DETECT_HEADER_VALUE
const SETTING_AUTO_HTTPS_DETECT_ENABLED
const SETTING_AUTO_HTTPS_DETECT_HEADER_NAME
const SETTING_FORCED
$factory
Definition: metadata.php:75
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
$ini
Definition: raiseError.php:4

References $factory, $ini, ILIAS\LTI\ToolProvider\$settings, ilHTTPS\SETTING_AUTO_HTTPS_DETECT_ENABLED, ilHTTPS\SETTING_AUTO_HTTPS_DETECT_HEADER_NAME, ilHTTPS\SETTING_AUTO_HTTPS_DETECT_HEADER_VALUE, ilHTTPS\SETTING_FORCED, ilHTTPS\SETTING_HTTP_PATH, ilHTTPS\SETTINGS_GROUP_HTTPS, and ilHTTPS\SETTINGS_GROUP_SERVER.

◆ getHash()

ilHttpConfigStoredObjective::getHash ( )

Definition at line 28 of file class.ilHttpConfigStoredObjective.php.

28 : string
29 {
30 return hash("sha256", self::class);
31 }

◆ getLabel()

ilHttpConfigStoredObjective::getLabel ( )

Definition at line 33 of file class.ilHttpConfigStoredObjective.php.

33 : string
34 {
35 return "Store configuration of Services/Http";
36 }

◆ getPreconditions()

ilHttpConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)
Returns
\ilIniFilesLoadedObjective[]|\ilSettingsFactoryExistsObjective[]

Definition at line 46 of file class.ilHttpConfigStoredObjective.php.

46 : array
47 {
48 return [
50 new \ilSettingsFactoryExistsObjective()
51 ];
52 }

◆ isApplicable()

ilHttpConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 101 of file class.ilHttpConfigStoredObjective.php.

101 : bool
102 {
103 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
104 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
105 $settings = $factory->settingsFor("common");
106
107 $detect_enabled = $this->config->isAutodetectionEnabled() ? "1" : "0";
108 $forced = $this->config->isForced() ? "1" : "0";
109
110 return
111 $ini->readVariable(ilHTTPS::SETTINGS_GROUP_SERVER, ilHTTPS::SETTING_HTTP_PATH) !== $this->config->getHttpPath() ||
113 $ini->readVariable(ilHTTPS::SETTINGS_GROUP_HTTPS, ilHTTPS::SETTING_FORCED) !== $forced ||
114 $ini->readVariable(ilHTTPS::SETTINGS_GROUP_HTTPS, ilHTTPS::SETTING_AUTO_HTTPS_DETECT_HEADER_NAME) !== $this->config->getHeaderName() ||
115 $ini->readVariable(ilHTTPS::SETTINGS_GROUP_HTTPS, ilHTTPS::SETTING_AUTO_HTTPS_DETECT_HEADER_VALUE) !== $this->config->getHeaderValue() ||
116 $settings->get("proxy_status") !== (int) $this->config->isProxyEnabled() ||
117 $settings->get("proxy_host") !== $this->config->getProxyHost() ||
118 $settings->get("proxy_port") !== $this->config->getProxyPort()
119 ;
120 }

References $factory, $ini, ILIAS\LTI\ToolProvider\$settings, ILIAS\Repository\int(), ilHTTPS\SETTING_AUTO_HTTPS_DETECT_ENABLED, ilHTTPS\SETTING_AUTO_HTTPS_DETECT_HEADER_NAME, ilHTTPS\SETTING_AUTO_HTTPS_DETECT_HEADER_VALUE, ilHTTPS\SETTING_FORCED, ilHTTPS\SETTING_HTTP_PATH, ilHTTPS\SETTINGS_GROUP_HTTPS, and ilHTTPS\SETTINGS_GROUP_SERVER.

+ Here is the call graph for this function:

◆ isNotable()

ilHttpConfigStoredObjective::isNotable ( )

Definition at line 38 of file class.ilHttpConfigStoredObjective.php.

38 : bool
39 {
40 return false;
41 }

Field Documentation

◆ $config

ilHttpSetupConfig ilHttpConfigStoredObjective::$config
protected

Definition at line 20 of file class.ilHttpConfigStoredObjective.php.

Referenced by __construct().


The documentation for this class was generated from the following file: