ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSystemFolderMetricsCollectedObjective.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\Setup;
20
22{
23 public function getTentativePreconditions(Setup\Environment $environment): array
24 {
25 return [
26 new \ilSettingsFactoryExistsObjective()
27 ];
28 }
29
30 public function collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage): void
31 {
32 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
33 if (!$factory) {
34 return;
35 }
36 $settings = $factory->settingsFor("common");
37 $firstname = new Setup\Metrics\Metric(
38 Setup\Metrics\Metric::STABILITY_CONFIG,
39 Setup\Metrics\Metric::TYPE_TEXT,
40 $settings->get("admin_firstname", "")
41 );
42 $lastname = new Setup\Metrics\Metric(
43 Setup\Metrics\Metric::STABILITY_CONFIG,
44 Setup\Metrics\Metric::TYPE_TEXT,
45 $settings->get("admin_lastname", "")
46 );
47 $email = new Setup\Metrics\Metric(
48 Setup\Metrics\Metric::STABILITY_CONFIG,
49 Setup\Metrics\Metric::TYPE_TEXT,
50 $settings->get("admin_email", "")
51 );
52 $contact = new Setup\Metrics\Metric(
53 Setup\Metrics\Metric::STABILITY_CONFIG,
54 Setup\Metrics\Metric::TYPE_COLLECTION,
55 [
56 "firstname" => $firstname,
57 "lastname" => $lastname,
58 "email" => $email
59 ],
60 "Contact information for this installation."
61 );
62 $storage->store("contact", $contact);
63 }
64}
A metric is something we can measure about the system.
Definition: Metric.php:34
collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage)
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
Storage is simple key/value store without further schema definition.
Definition: Storage.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...