ILIAS  release_8 Revision v8.24
class.ilFileSystemConfigNotChangedObjective.php
Go to the documentation of this file.
1<?php
2
4
5/******************************************************************************
6 *
7 * This file is part of ILIAS, a powerful learning management system.
8 *
9 * ILIAS is licensed with the GPL-3.0, you should have received a copy
10 * of said license along with the source code.
11 *
12 * If this is not the case or you just want to try ILIAS, you'll find
13 * us at:
14 * https://www.ilias.de
15 * https://github.com/ILIAS-eLearning
16 *
17 *****************************************************************************/
19{
20 protected \ilFileSystemSetupConfig $config;
21
22 public function __construct(
24 ) {
25 $this->config = $config;
26 }
27
28 public function getHash(): string
29 {
30 return hash("sha256", self::class);
31 }
32
33 public function getLabel(): string
34 {
35 return "Config for Filesystems did not change.";
36 }
37
38 public function isNotable(): bool
39 {
40 return false;
41 }
42
46 public function getPreconditions(Setup\Environment $environment): array
47 {
48 return [
51 ];
52 }
53
54 public function achieve(Setup\Environment $environment): Setup\Environment
55 {
56 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
57
58 $current = $ini->readVariable("clients", "datadir");
59 $new = $this->config->getDataDir();
60 if ($current !== $new) {
62 "You seem to try to move the ILIAS data-directory from '$current' " .
63 "to '$new', the client.ini.php contains a different path then the " .
64 "config you are using. This is not supported by the setup."
65 );
66 }
67
68 return $environment;
69 }
70
74 public function isApplicable(Setup\Environment $environment): bool
75 {
76 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
77
78 return $ini->readVariable("clients", "datadir") !== $this->config->getDataDir();
79 }
80}
Signals that some goal won't be achievable by actions of the system ever.
isApplicable(Setup\Environment $environment)
@inheritDoc
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ini
Definition: raiseError.php:4