ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 @inheritDoc More...
 
 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)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

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

LogicException if there are unfullfilled preconditions.

Exceptions

RuntimeException if there are missing resources.

Implements ILIAS\Setup\Objective.

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

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.
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
$ini
Definition: raiseError.php:20

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

+ 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)
Returns
\ilFileSystemDirectoriesCreatedObjective[]|\ilIniFilesLoadedObjective[]

Implements ILIAS\Setup\Objective.

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

◆ isApplicable()

ilFileSystemConfigNotChangedObjective::isApplicable ( Environment  $environment)

@inheritDoc

Implements ILIAS\Setup\Objective.

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

75 : bool
76 {
77 $ini = $environment->getResource(Environment::RESOURCE_ILIAS_INI);
78
79 return $ini->readVariable("clients", "datadir") !== $this->config->getDataDir();
80 }

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

+ 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: