39 : void
40 {
41 $client_ini = $environment->
getResource(Environment::RESOURCE_CLIENT_INI);
42 if ($client_ini) {
44 "type",
45 $client_ini->readVariable("db", "type") ?? "mysql",
46 "The storage backend that is used for the database."
47 );
49 "host",
50 $client_ini->readVariable("db", "host"),
51 "The host where the storage backend is located."
52 );
54 "port",
55 $client_ini->readVariable("db", "port"),
56 "The port where the storage backend is located at the host."
57 );
59 "name",
60 $client_ini->readVariable("db", "name"),
61 "The name of the database in the storage backend."
62 );
64 "user",
65 $client_ini->readVariable("db", "user"),
66 "The user to be used for the storage backend."
67 );
69 "pass",
70 PHP_SAPI === 'cli' ? $client_ini->readVariable("db", "pass") : '********',
71 "The password for the user for the storage backend."
72 );
73 }
74
75
76 $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
79 return;
80 }
82
83
84
85
86
88 try {
92 $GLOBALS[
"DIC"][
"ilLog"] =
new class () {
93 public function write(): void
94 {
95 }
96 public function info(): void
97 {
98 }
99 public function warning($msg): void
100 {
101 }
102 public function error($msg): void
103 {
104 }
105 };
107 $GLOBALS[
"DIC"][
"ilLoggerFactory"] =
new class () {
108 public function getRootLogger():
object
109 {
110 return new class () {
111 public function write(): void
112 {
113 }
114 };
115 }
116 };
117 if (!defined("CLIENT_DATA_DIR")) {
118 define(
"CLIENT_DATA_DIR",
$ini->readVariable(
"clients",
"datadir") .
"/" .
$client_id);
119 }
120 if (!defined("CLIENT_WEB_DIR")) {
121 define(
"CLIENT_WEB_DIR", dirname(__DIR__, 4) .
"/data/" .
$client_id);
122 }
123 if (!defined("ILIAS_ABSOLUTE_PATH")) {
124 define("ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
125 }
126 if (!defined("ILIAS_LOG_ENABLED")) {
127 define("ILIAS_LOG_ENABLED", false);
128 }
129 if (!defined("ROOT_FOLDER_ID")) {
130 define("ROOT_FOLDER_ID", (int) $client_ini->readVariable("system", "ROOT_FOLDER_ID"));
131 }
132 if (!defined("ROLE_FOLDER_ID")) {
133 define("ROLE_FOLDER_ID", (int) $client_ini->readVariable("system", "ROLE_FOLDER_ID"));
134 }
135 if (!defined("SYSTEM_FOLDER_ID")) {
136 define("SYSTEM_FOLDER_ID", (int) $client_ini->readVariable("system", "SYSTEM_FOLDER_ID"));
137 }
138
140
142 "custom_version",
143 $db_update->getCustomUpdatesCurrentVersion() ?? 0,
144 "The version of the custom database schema that is currently installed."
145 );
147 "available_custom_version",
148 $db_update->getCustomUpdatesFileVersion() ?? 0,
149 "The version of the custom database schema that is available in the current source."
150 );
152 "custom_update_required",
153 $db_update->customUpdatesAvailable(),
154 "Does the database require a custom update?"
155 );
156 } finally {
158 }
159 }
Customizing of pimple-DIC for ILIAS.
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
storeStableBool(string $key, bool $value, ?string $description=null)
storeConfigText(string $key, string $value, ?string $description=null)
storeStableCounter(string $key, int $value, ?string $description=null)