ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSystemFolderMetricsCollectedObjective.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2020 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
8{
9 public function getTentativePreconditions(Setup\Environment $environment) : array
10 {
11 return [
12 new \ilSettingsFactoryExistsObjective()
13 ];
14 }
15
16 public function collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage) : void
17 {
18 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
19 if (!$factory) {
20 return;
21 }
22 $settings = $factory->settingsFor("common");
23 $firstname = new Setup\Metrics\Metric(
24 Setup\Metrics\Metric::STABILITY_CONFIG,
25 Setup\Metrics\Metric::TYPE_TEXT,
26 $settings->get("admin_firstname")
27 );
28 $lastname = new Setup\Metrics\Metric(
29 Setup\Metrics\Metric::STABILITY_CONFIG,
30 Setup\Metrics\Metric::TYPE_TEXT,
31 $settings->get("admin_lastname")
32 );
34 Setup\Metrics\Metric::STABILITY_CONFIG,
35 Setup\Metrics\Metric::TYPE_TEXT,
36 $settings->get("admin_email")
37 );
38 $contact = new Setup\Metrics\Metric(
39 Setup\Metrics\Metric::STABILITY_CONFIG,
40 Setup\Metrics\Metric::TYPE_COLLECTION,
41 [
42 "firstname" => $firstname,
43 "lastname" => $lastname,
44 "email" => $email
45 ],
46 "Contact information for this installation."
47 );
48 $storage->store("contact", $contact);
49 }
50}
An exception for terminatinating execution or to throw for unit testing.
A metric is something we can measure about the system.
Definition: Metric.php:18
collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage)
An environment holds resources to be used in the setup process.
Definition: Environment.php:12
$factory
Definition: metadata.php:58
if( $orgName !==null) if($spconfig->hasValue('contacts')) $email
Definition: metadata.php:285
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...