ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilInstallationInformationStoredObjective Class Reference

Store information about the installation, like title, description and contact information in the according fields in the ini or database. More...

+ Inheritance diagram for ilInstallationInformationStoredObjective:
+ Collaboration diagram for ilInstallationInformationStoredObjective:

Public Member Functions

 __construct (\ilSystemFolderSetupConfig $config)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 

Protected Attributes

 $config
 

Detailed Description

Store information about the installation, like title, description and contact information in the according fields in the ini or database.

Definition at line 11 of file class.ilInstallationInformationStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilInstallationInformationStoredObjective::__construct ( \ilSystemFolderSetupConfig  $config)

Member Function Documentation

◆ achieve()

ilInstallationInformationStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 48 of file class.ilInstallationInformationStoredObjective.php.

References $factory, and $ini.

48  : Setup\Environment
49  {
50  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
51  $common_config = $environment->getConfigFor("common");
52 
53  $settings = $factory->settingsFor("common");
54  $ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
55 
56  $settings->set("inst_name", $this->config->getClientName());
57  $ini->setVariable("client", "name", $this->config->getClientName() ?? $common_config->getClientId());
58  $ini->setVariable("client", "description", $this->config->getClientDescription());
59  $settings->set("inst_institution", $this->config->getClientInstitution());
60  $settings->set("admin_firstname", $this->config->getContactFirstname());
61  $settings->set("admin_lastname", $this->config->getContactLastname());
62  $settings->set("admin_title", $this->config->getContactTitle());
63  $settings->set("admin_position", $this->config->getContactPosition());
64  $settings->set("admin_institution", $this->config->getContactInstitution());
65  $settings->set("admin_street", $this->config->getContactStreet());
66  $settings->set("admin_zipcode", $this->config->getContactZipcode());
67  $settings->set("admin_city", $this->config->getContactCity());
68  $settings->set("admin_country", $this->config->getContactCountry());
69  $settings->set("admin_phone", $this->config->getContactPhone());
70  $settings->set("admin_email", $this->config->getContactEMail());
71 
72  if (!$ini->write()) {
73  throw new Setup\UnachievableException("Could not write client.ini.php");
74  }
75 
76  return $environment;
77  }
$factory
Definition: metadata.php:58
$ini
Definition: raiseError.php:4

◆ getHash()

ilInstallationInformationStoredObjective::getHash ( )

Definition at line 24 of file class.ilInstallationInformationStoredObjective.php.

24  : string
25  {
26  return hash("sha256", self::class);
27  }

◆ getLabel()

ilInstallationInformationStoredObjective::getLabel ( )

Definition at line 29 of file class.ilInstallationInformationStoredObjective.php.

29  : string
30  {
31  return "Store information about installation and contact in the settings";
32  }

◆ getPreconditions()

ilInstallationInformationStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 39 of file class.ilInstallationInformationStoredObjective.php.

39  : array
40  {
41  $common_config = $environment->getConfigFor("common");
42  return [
43  new \ilIniFilesPopulatedObjective($common_config),
44  new \ilSettingsFactoryExistsObjective()
45  ];
46  }

◆ isNotable()

ilInstallationInformationStoredObjective::isNotable ( )

Definition at line 34 of file class.ilInstallationInformationStoredObjective.php.

34  : bool
35  {
36  return true;
37  }

Field Documentation

◆ $config

ilInstallationInformationStoredObjective::$config
protected

Definition at line 16 of file class.ilInstallationInformationStoredObjective.php.

Referenced by __construct().


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