ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUtilitiesConfigStoredObjective Class Reference

Stores configuration for the Utilities service (paths to various tools) in the according ini-fields. More...

+ Inheritance diagram for ilUtilitiesConfigStoredObjective:
+ Collaboration diagram for ilUtilitiesConfigStoredObjective:

Public Member Functions

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

Protected Attributes

ilUtilitiesSetupConfig $config
 

Detailed Description

Stores configuration for the Utilities service (paths to various tools) in the according ini-fields.

Definition at line 27 of file class.ilUtilitiesConfigStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilUtilitiesConfigStoredObjective::__construct ( ilUtilitiesSetupConfig  $config)

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

References $config.

32  {
33  $this->config = $config;
34  }

Member Function Documentation

◆ achieve()

ilUtilitiesConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 58 of file class.ilUtilitiesConfigStoredObjective.php.

References $ini.

58  : Setup\Environment
59  {
60  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
61 
62  $ini->setVariable("tools", "convert", $this->config->getPathToConvert());
63  $ini->setVariable("tools", "zip", $this->config->getPathToZip());
64  $ini->setVariable("tools", "unzip", $this->config->getPathToUnzip());
65 
66  if (!$ini->write()) {
67  throw new Setup\UnachievableException("Could not write ilias.ini.php");
68  }
69 
70  return $environment;
71  }
$ini
Definition: raiseError.php:4

◆ getHash()

ilUtilitiesConfigStoredObjective::getHash ( )

Definition at line 36 of file class.ilUtilitiesConfigStoredObjective.php.

36  : string
37  {
38  return hash("sha256", self::class);
39  }

◆ getLabel()

ilUtilitiesConfigStoredObjective::getLabel ( )

Definition at line 41 of file class.ilUtilitiesConfigStoredObjective.php.

41  : string
42  {
43  return "Store configuration of Services/Utilities";
44  }

◆ getPreconditions()

ilUtilitiesConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 51 of file class.ilUtilitiesConfigStoredObjective.php.

51  : array
52  {
53  return [
55  ];
56  }

◆ isApplicable()

ilUtilitiesConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 76 of file class.ilUtilitiesConfigStoredObjective.php.

References $ini.

76  : bool
77  {
78  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
79 
80  return
81  $ini->readVariable("tools", "convert") !== $this->config->getPathToConvert() ||
82  $ini->readVariable("tools", "zip") !== $this->config->getPathToZip() ||
83  $ini->readVariable("tools", "unzip") !== $this->config->getPathToUnzip();
84  }
$ini
Definition: raiseError.php:4

◆ isNotable()

ilUtilitiesConfigStoredObjective::isNotable ( )

Definition at line 46 of file class.ilUtilitiesConfigStoredObjective.php.

46  : bool
47  {
48  return false;
49  }

Field Documentation

◆ $config

ilUtilitiesSetupConfig ilUtilitiesConfigStoredObjective::$config
protected

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

Referenced by __construct().


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