ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLanguageConfigStoredObjective.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 "Fill ini with settings for Services/Language";
17 }
18
19 public function isNotable() : bool
20 {
21 return false;
22 }
23
24 public function getPreconditions(Setup\Environment $environment) : array
25 {
26 $common_config = $environment->getConfigFor("common");
27 return [
28 new ilIniFilesPopulatedObjective($common_config)
29 ];
30 }
31
32 public function achieve(Setup\Environment $environment) : Setup\Environment
33 {
34 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
35
36 $client_ini->setVariable("language", "default", $this->config->getDefaultLanguage());
37
38 if (!$client_ini->write()) {
39 throw new Setup\UnachievableException("Could not write client.ini.php");
40 }
41
42 return $environment;
43 }
44}
An exception for terminatinating execution or to throw for unit testing.
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:12
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.