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

Public Member Functions

 getTentativePreconditions (Setup\Environment $environment)
 
 collectFrom (Setup\Environment $environment, Setup\Metrics\Storage $storage)
 

Detailed Description

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

Member Function Documentation

◆ collectFrom()

ilHttpMetricsCollectedObjective::collectFrom ( Setup\Environment  $environment,
Setup\Metrics\Storage  $storage 
)

Definition at line 31 of file class.ilHttpMetricsCollectedObjective.php.

31 : void
32 {
33 $ilias_ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
34
35 if ($ilias_ini) {
36 $storage->storeConfigText(
37 "http_path",
38 $ilias_ini->readVariable("server", "http_path"),
39 "URL of the server."
40 );
41 $storage->storeConfigText(
42 "https forced",
43 $ilias_ini->readVariable("https", "forced"),
44 ""
45 );
46
47 if ($ilias_ini->readVariable("https", "auto_https_detect_enabled")) {
48 $header_name = new Setup\Metrics\Metric(
49 Setup\Metrics\Metric::STABILITY_CONFIG,
50 Setup\Metrics\Metric::TYPE_TEXT,
51 $ilias_ini->readVariable("https", "auto_https_detect_header_name"),
52 "The name of the header used for https detection in requests."
53 );
54 $header_value = new Setup\Metrics\Metric(
55 Setup\Metrics\Metric::STABILITY_CONFIG,
56 Setup\Metrics\Metric::TYPE_TEXT,
57 $ilias_ini->readVariable("https", "auto_https_detect_header_value"),
58 "The value in the named header that indicates usage of https in requests."
59 );
60 $https_metrics = new Setup\Metrics\Metric(
61 Setup\Metrics\Metric::STABILITY_CONFIG,
62 Setup\Metrics\Metric::TYPE_COLLECTION,
63 [
64 "header_name" => $header_name,
65 "header_value" => $header_value
66 ],
67 "The properties of a request used for https detection."
68 );
69 $storage->store("https_autodetection", $https_metrics);
70 } else {
71 $storage->storeConfigBool(
72 "https_autodetection",
73 false,
74 "Does the server attempt to detect https in incoming requests?"
75 );
76 }
77 }
78
79 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
80 if (!$factory) {
81 return;
82 }
83 $settings = $factory->settingsFor("common");
84
85 if ($settings->get("proxy_status")) {
86 $host = new Setup\Metrics\Metric(
87 Setup\Metrics\Metric::STABILITY_CONFIG,
88 Setup\Metrics\Metric::TYPE_TEXT,
89 $settings->get("proxy_host"),
90 "The host of the proxy."
91 );
92 $port = new Setup\Metrics\Metric(
93 Setup\Metrics\Metric::STABILITY_CONFIG,
94 Setup\Metrics\Metric::TYPE_TEXT,
95 $settings->get("proxy_port"),
96 "The port of the proxy."
97 );
98 $proxy = new Setup\Metrics\Metric(
99 Setup\Metrics\Metric::STABILITY_CONFIG,
100 Setup\Metrics\Metric::TYPE_COLLECTION,
101 [
102 "host" => $host,
103 "port" => $port
104 ],
105 "The proxy that is used for outgoing connections."
106 );
107 $storage->store("proxy", $proxy);
108 } else {
109 $storage->storeConfigBool(
110 "proxy",
111 false,
112 "Does the server use a proxy for outgoing connections?"
113 );
114 }
115 }
$factory
Definition: metadata.php:75
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $factory, and ILIAS\LTI\ToolProvider\$settings.

◆ getTentativePreconditions()

ilHttpMetricsCollectedObjective::getTentativePreconditions ( Setup\Environment  $environment)
Returns
\ilIniFilesLoadedObjective[]|\ilSettingsFactoryExistsObjective[]

Definition at line 23 of file class.ilHttpMetricsCollectedObjective.php.

23 : array
24 {
25 return [
27 new \ilSettingsFactoryExistsObjective()
28 ];
29 }

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