19 declare(strict_types=1);
28 return hash(
"sha256", self::class);
33 return "The database is updated.";
47 $preconditions[] =
new Setup\Objective\ClientIdReadObjective();
51 return $preconditions;
56 $db = $environment->
getResource(Setup\Environment::RESOURCE_DATABASE);
57 $io = $environment->getResource(Setup\Environment::RESOURCE_ADMIN_INTERACTION);
58 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
59 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
60 $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
68 $GLOBALS[
"DIC"] =
new DI\Container();
72 $GLOBALS[
"DIC"][
"ilLog"] =
new class ($io) {
79 public function write():
void 83 public function info():
void 87 public function warning($msg):
void 89 $this->io->inform($msg);
92 public function error($msg):
void 94 throw new Setup\UnachievableException(
95 "Problem in DB-Update: $msg" 100 $GLOBALS[
"DIC"][
"ilLoggerFactory"] =
new class () {
101 public function getRootLogger():
object 103 return new class () {
104 public function write():
void 110 $GLOBALS[
"ilCtrlStructureReader"] =
new class () {
111 public function getStructure():
void 115 public function setIniFile():
void 119 if (!defined(
"CLIENT_DATA_DIR")) {
120 define(
"CLIENT_DATA_DIR",
$ini->readVariable(
"clients",
"datadir") .
"/" .
$client_id);
122 if (!defined(
"CLIENT_WEB_DIR")) {
123 define(
"CLIENT_WEB_DIR", dirname(__DIR__, 4) .
"/data/" .
$client_id);
125 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
126 define(
"ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
128 if (!defined(
"ILIAS_LOG_ENABLED")) {
129 define(
"ILIAS_LOG_ENABLED",
false);
131 if (!defined(
"ROOT_FOLDER_ID")) {
132 define(
"ROOT_FOLDER_ID", (
int) $client_ini->readVariable(
"system",
"ROOT_FOLDER_ID"));
134 if (!defined(
"ROLE_FOLDER_ID")) {
135 define(
"ROLE_FOLDER_ID", (
int) $client_ini->readVariable(
"system",
"ROLE_FOLDER_ID"));
137 if (!defined(
"SYSTEM_FOLDER_ID")) {
138 define(
"SYSTEM_FOLDER_ID", (
int) $client_ini->readVariable(
"system",
"SYSTEM_FOLDER_ID"));
142 $db_update->applyCustomUpdates();
getPreconditions(Setup\Environment $environment)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isApplicable(Setup\Environment $environment)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
achieve(Setup\Environment $environment)