39 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
41 $storage->storeConfigText(
43 $client_ini->readVariable(
"db",
"type") ??
"mysql",
44 "The storage backend that is used for the database." 46 $storage->storeConfigText(
48 $client_ini->readVariable(
"db",
"host"),
49 "The host where the storage backend is located." 51 $storage->storeConfigText(
53 $client_ini->readVariable(
"db",
"port"),
54 "The port where the storage backend is located at the host." 56 $storage->storeConfigText(
58 $client_ini->readVariable(
"db",
"name"),
59 "The name of the database in the storage backend." 61 $storage->storeConfigText(
63 $client_ini->readVariable(
"db",
"user"),
64 "The user to be used for the storage backend." 66 $storage->storeConfigText(
68 PHP_SAPI ===
'cli' ? $client_ini->readVariable(
"db",
"pass") :
'********',
69 "The password for the user for the storage backend." 74 $db = $environment->getResource(Setup\Environment::RESOURCE_DATABASE);
75 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
79 $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
87 $GLOBALS[
"DIC"] =
new DI\Container();
90 $GLOBALS[
"DIC"][
"ilLog"] =
new class () {
91 public function write(): void
94 public function info(): void
97 public function warning($msg): void
100 public function error($msg): void
105 $GLOBALS[
"DIC"][
"ilLoggerFactory"] =
new class () {
106 public function getRootLogger():
object 108 return new class () {
109 public function write(): void
115 if (!defined(
"CLIENT_DATA_DIR")) {
116 define(
"CLIENT_DATA_DIR",
$ini->readVariable(
"clients",
"datadir") .
"/" .
$client_id);
118 if (!defined(
"CLIENT_WEB_DIR")) {
119 define(
"CLIENT_WEB_DIR", dirname(__DIR__, 4) .
"/data/" .
$client_id);
121 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
122 define(
"ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
124 if (!defined(
"ILIAS_LOG_ENABLED")) {
125 define(
"ILIAS_LOG_ENABLED",
false);
127 if (!defined(
"ROOT_FOLDER_ID")) {
128 define(
"ROOT_FOLDER_ID", (
int) $client_ini->readVariable(
"system",
"ROOT_FOLDER_ID"));
130 if (!defined(
"ROLE_FOLDER_ID")) {
131 define(
"ROLE_FOLDER_ID", (
int) $client_ini->readVariable(
"system",
"ROLE_FOLDER_ID"));
133 if (!defined(
"SYSTEM_FOLDER_ID")) {
134 define(
"SYSTEM_FOLDER_ID", (
int) $client_ini->readVariable(
"system",
"SYSTEM_FOLDER_ID"));
139 $storage->storeStableCounter(
141 $db_update->getCustomUpdatesCurrentVersion() ?? 0,
142 "The version of the custom database schema that is currently installed." 144 $storage->storeStableCounter(
145 "available_custom_version",
146 $db_update->getCustomUpdatesFileVersion() ?? 0,
147 "The version of the custom database schema that is available in the current source." 149 $storage->storeStableBool(
150 "custom_update_required",
151 $db_update->customUpdatesAvailable(),
152 "Does the database require a custom update?"