ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 @inheritDoc More...
 
- Public Member Functions inherited from ilSetupObjective
 __construct (\ilSetupConfig $config)
 

Protected Member Functions

 generateNICKey ()
 

Additional Inherited Members

- Protected Attributes inherited from ilSetupObjective
 $config
 

Detailed Description

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

Member Function Documentation

◆ achieve()

ilNICKeyStoredObjective::achieve ( Setup\Environment  $environment)

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

31 : Setup\Environment
32 {
33 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
34 $settings = $factory->settingsFor("common");
35
36 $nic_key = $this->generateNICKey();
37 $settings->set("nic_key", $nic_key);
38
39 return $environment;
40 }
$factory
Definition: metadata.php:58

References $factory, and generateNICKey().

+ Here is the call graph for this function:

◆ generateNICKey()

ilNICKeyStoredObjective::generateNICKey ( )
protected

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

54 {
55 return md5(uniqid($this->getClientId(), true));
56 }

Referenced by achieve().

+ Here is the caller graph for this function:

◆ getHash()

ilNICKeyStoredObjective::getHash ( )

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

9 : string
10 {
11 return hash("sha256", self::class);
12 }

◆ getLabel()

ilNICKeyStoredObjective::getLabel ( )

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

14 : string
15 {
16 return "A NIC key for the installation is generated and stored";
17 }

◆ getPreconditions()

ilNICKeyStoredObjective::getPreconditions ( Setup\Environment  $environment)

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

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

◆ isApplicable()

ilNICKeyStoredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

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

45 : bool
46 {
47 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
48 $settings = $factory->settingsFor("common");
49
50 return !(bool) $settings->get("nic_key");
51 }

References $factory.

◆ isNotable()

ilNICKeyStoredObjective::isNotable ( )

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

19 : bool
20 {
21 return true;
22 }

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