ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilIniFilesPopulatedObjective.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
8{
9 public function getHash() : string
10 {
11 return hash("sha256", self::class);
12 }
13
14 public function getLabel() : string
15 {
16 return "The ilias.ini.php and client.ini.php are populated.";
17 }
18
19 public function isNotable() : bool
20 {
21 return true;
22 }
23
24 public function getPreconditions(Setup\Environment $environment) : array
25 {
26 // TODO: This shows an unfortunate connection between the webdir and the
27 // client.ini.php. Why does the client in reside in the webdir? If we
28 // remove the client-feature, the client-ini will go away...
29 return [
30 new \ilOverwritesExistingInstallationConfirmed($this->config),
31 new Setup\DirectoryCreatedObjective(dirname(__DIR__, 2) . "/data"),
34 new Setup\CanCreateFilesInDirectoryCondition(dirname(__DIR__, 2)),
35 ];
36 }
37
38 public function achieve(Setup\Environment $environment) : Setup\Environment
39 {
40 $path = dirname(__DIR__, 2) . "/ilias.ini.php";
41 $ini = new ilIniFile($path);
42 $ini->GROUPS = parse_ini_file(__DIR__ . "/../ilias.master.ini.php", true);
43 $ini->write();
44
45 $path = $this->getClientDir() . "/client.ini.php";
46 $client_ini = new ilIniFile($path);
47 $client_ini->GROUPS = parse_ini_file(__DIR__ . "/../client.master.ini.php", true);
48 $client_ini->write();
49
50 return $environment
51 ->withResource(Setup\Environment::RESOURCE_ILIAS_INI, $ini)
52 ->withResource(Setup\Environment::RESOURCE_CLIENT_INI, $client_ini);
53 }
54
55 protected function getClientDir() : string
56 {
57 return dirname(__DIR__, 2) . "/data/" . $this->config->getClientId();
58 }
59}
An exception for terminatinating execution or to throw for unit testing.
INIFile Parser.
getPreconditions(Setup\Environment $environment)
An environment holds resources to be used in the setup process.
Definition: Environment.php:12
$ini
Definition: raiseError.php:4