ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
CalledFromRootObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Setup\Objective;
22
23use ILIAS\Setup;
24
29{
30 public function getHash(): string
31 {
32 return hash("sha256", self::class);
33 }
34
35 public function getLabel(): string
36 {
37 return "Verify that the setup is called from ilias' root-directory.";
38 }
39
40 public function isNotable(): bool
41 {
42 return true;
43 }
44
45 public function getPreconditions(Setup\Environment $environment): array
46 {
47 return [];
48 }
49
50 public function achieve(Setup\Environment $environment): Setup\Environment
51 {
52 $ilroot = dirname(__DIR__, 5);
53 if (getcwd() !== $ilroot) {
54 $msg = "Please run the setup from ILIAS root - "
55 . "there are components using relative pathes.";
56 throw new Setup\UnachievableException($msg);
57 }
58 return $environment;
59 }
60
61 public function isApplicable(Setup\Environment $environment): bool
62 {
63 return true;
64 }
65}
Verify that the setip is called from ILIAS root directory.
getLabel()
Get a label that describes this objective.
isNotable()
Get to know if this is an interesting objective for a human.
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
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...