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

Public Member Functions

 __construct (protected \ilFileSystemSetupConfig $config)
 
 getHash ()
 Get a hash for this objective. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Environment $environment)
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilFileSystemConfigNotChangedObjective::__construct ( protected \ilFileSystemSetupConfig  $config)

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

26  {
27  }

Member Function Documentation

◆ achieve()

ilFileSystemConfigNotChangedObjective::achieve ( Environment  $environment)

Objectives can be achieved.

They might add resources to the environment when they have been achieved.

This method needs to be idempotent for a given environment. That means: if this is executed a second time, nothing new should happen. Or the other way round: if the environment already looks like desired, the objective should not take any further actions when this is called.

Exceptions

Implements ILIAS\Setup\Objective.

Definition at line 55 of file class.ilFileSystemConfigNotChangedObjective.php.

References $ini, and ILIAS\Setup\Environment\getResource().

55  : Environment
56  {
57  $ini = $environment->getResource(Environment::RESOURCE_ILIAS_INI);
58 
59  $current = $ini->readVariable("clients", "datadir");
60  $new = $this->config->getDataDir();
61  if ($current !== $new) {
62  throw new UnachievableException(
63  "You seem to try to move the ILIAS data-directory from '$current' " .
64  "to '$new', the client.ini.php contains a different path then the " .
65  "config you are using. This is not supported by the setup."
66  );
67  }
68 
69  return $environment;
70  }
Signals that some goal won't be achievable by actions of the system ever.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
$ini
Definition: raiseError.php:20
+ Here is the call graph for this function:

◆ getHash()

ilFileSystemConfigNotChangedObjective::getHash ( )

Get a hash for this objective.

The hash of two objectives must be the same, if they are the same objective, with the same config on the same environment, i.e. if the one is achieved the other is achieved as well because they are the same.

Implements ILIAS\Setup\Objective.

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

29  : string
30  {
31  return hash("sha256", self::class);
32  }

◆ getLabel()

ilFileSystemConfigNotChangedObjective::getLabel ( )

Get a label that describes this objective.

Implements ILIAS\Setup\Objective.

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

34  : string
35  {
36  return "Config for Filesystems did not change.";
37  }

◆ getPreconditions()

ilFileSystemConfigNotChangedObjective::getPreconditions ( Environment  $environment)

◆ isApplicable()

ilFileSystemConfigNotChangedObjective::isApplicable ( Environment  $environment)

Implements ILIAS\Setup\Objective.

Definition at line 75 of file class.ilFileSystemConfigNotChangedObjective.php.

References $ini, and ILIAS\Setup\Environment\getResource().

75  : bool
76  {
77  $ini = $environment->getResource(Environment::RESOURCE_ILIAS_INI);
78 
79  return $ini->readVariable("clients", "datadir") !== $this->config->getDataDir();
80  }
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
$ini
Definition: raiseError.php:20
+ Here is the call graph for this function:

◆ isNotable()

ilFileSystemConfigNotChangedObjective::isNotable ( )

Get to know if this is an interesting objective for a human.

Implements ILIAS\Setup\Objective.

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

39  : bool
40  {
41  return false;
42  }

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