ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilNICKeyStoredObjective Class Reference
+ Inheritance diagram for ilNICKeyStoredObjective:
+ Collaboration diagram for ilNICKeyStoredObjective:

Public Member Functions

 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ilSetupObjective
 __construct (Setup\Config $config)
 

Protected Member Functions

 generateNICKey ()
 

Additional Inherited Members

- Protected Attributes inherited from ilSetupObjective
Setup Config $config
 

Detailed Description

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

Member Function Documentation

◆ achieve()

ilNICKeyStoredObjective::achieve ( Setup\Environment  $environment)

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

References generateNICKey(), and ILIAS\Setup\Environment\getResource().

48  : Setup\Environment
49  {
50  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
51  $settings = $factory->settingsFor("common");
52 
53  $nic_key = $this->generateNICKey();
54  $settings->set("nic_key", $nic_key);
55 
56  return $environment;
57  }
+ Here is the call graph for this function:

◆ generateNICKey()

ilNICKeyStoredObjective::generateNICKey ( )
protected

Definition at line 70 of file class.ilNICKeyStoredObjective.php.

Referenced by achieve().

71  {
72  return md5(uniqid((string) $this->config->getClientId(), true));
73  }
+ Here is the caller graph for this function:

◆ getHash()

ilNICKeyStoredObjective::getHash ( )

Definition at line 25 of file class.ilNICKeyStoredObjective.php.

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

◆ getLabel()

ilNICKeyStoredObjective::getLabel ( )

Definition at line 30 of file class.ilNICKeyStoredObjective.php.

30  : string
31  {
32  return "A NIC key for the installation is generated and stored";
33  }

◆ getPreconditions()

ilNICKeyStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 40 of file class.ilNICKeyStoredObjective.php.

40  : array
41  {
42  return [
43  new \ilSettingsFactoryExistsObjective(),
44  new ilInstIdDefaultStoredObjective($this->config)
45  ];
46  }

◆ isApplicable()

ilNICKeyStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 62 of file class.ilNICKeyStoredObjective.php.

62  : bool
63  {
64  $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
65  $settings = $factory->settingsFor("common");
66 
67  return !(bool) $settings->get("nic_key");
68  }

◆ isNotable()

ilNICKeyStoredObjective::isNotable ( )

Definition at line 35 of file class.ilNICKeyStoredObjective.php.

35  : bool
36  {
37  return true;
38  }

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