ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilFileSystemConfigNotChangedObjective.php
Go to the documentation of this file.
1<?php
2
22
24{
25 public function __construct(protected \ilFileSystemSetupConfig $config)
26 {
27 }
28
29 public function getHash(): string
30 {
31 return hash("sha256", self::class);
32 }
33
34 public function getLabel(): string
35 {
36 return "Config for Filesystems did not change.";
37 }
38
39 public function isNotable(): bool
40 {
41 return false;
42 }
43
47 public function getPreconditions(Environment $environment): array
48 {
49 return [
52 ];
53 }
54
55 public function achieve(Environment $environment): 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 }
71
75 public function isApplicable(Environment $environment): bool
76 {
77 $ini = $environment->getResource(Environment::RESOURCE_ILIAS_INI);
78
79 return $ini->readVariable("clients", "datadir") !== $this->config->getDataDir();
80 }
81}
Signals that some goal won't be achievable by actions of the system ever.
isNotable()
Get to know if this is an interesting objective for a human.
achieve(Environment $environment)
Objectives can be achieved.
getLabel()
Get a label that describes this objective.
__construct(protected \ilFileSystemSetupConfig $config)
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.
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
$ini
Definition: raiseError.php:20