ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
inc.setup_header.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
32// remove notices from error reporting
34
35error_reporting((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED);
36
37require_once __DIR__ . "/../../libs/composer/vendor/autoload.php";
38
39$DIC = new \ILIAS\DI\Container();
40
41define("DEBUG", false);
42
43//require_once "./Services/UICore/classes/class.ilTemplateHTMLITX.php";
44require_once "./setup/classes/class.ilTemplate.php"; // modified class. needs to be merged with base template class
45require_once "./setup/classes/class.ilLanguage.php"; // modified class. needs to be merged with base language class
46require_once "./Services/Logging/classes/class.ilLog.php";
47require_once "./Services/Authentication/classes/class.ilSession.php";
48require_once "./Services/Utilities/classes/class.ilUtil.php";
49require_once "./Services/Init/classes/class.ilIniFile.php";
50require_once "./setup/classes/class.ilSetupGUI.php";
51require_once "./setup/classes/class.Session.php";
52require_once "./setup/classes/class.ilClientList.php";
53require_once "./setup/classes/class.ilClient.php";
54require_once "./Services/FileSystem/classes/class.ilFile.php";
55require_once "./setup/classes/class.ilCtrlStructureReader.php";
56require_once "./Services/Xml/classes/class.ilSaxParser.php";
57require_once "./include/inc.ilias_version.php";
58include_once './Services/Logging/classes/public/class.ilLogLevel.php';
59
60// set ilias pathes
61if ($_SERVER['HTTPS'] == 'on') {
62 define("ILIAS_HTTP_PATH", substr("https://" . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]), 0, -6));
63} else {
64 define("ILIAS_HTTP_PATH", substr("http://" . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]), 0, -6));
65}
66
67
68// PHP is running in CGI mode?
69if (isset($_SERVER["REDIRECT_STATUS"]) && !isset($_SERVER["FCGI_ROLE"])) {
70 if ($_SERVER["PATH_TRANSLATED"] != "") {
71 define("ILIAS_ABSOLUTE_PATH", substr(dirname($_SERVER["PATH_TRANSLATED"]), 0, -6));
72 } else {
73 define("ILIAS_ABSOLUTE_PATH", substr(dirname($_SERVER["SCRIPT_FILENAME"]), 0, -6));
74 }
75} elseif ($_SERVER["SCRIPT_FILENAME"] != "") {
76 define("ILIAS_ABSOLUTE_PATH", substr(dirname($_SERVER["SCRIPT_FILENAME"]), 0, -6));
77} else {
78 // included this due to http://education2news.blogspot.com.es/2012/06/installing-ilias-424.html
79 define('ILIAS_ABSOLUTE_PATH', str_replace("/setup/include", "", dirname(__FILE__)));
80}
81
82// set default timezone
83include_once './Services/Calendar/classes/class.ilTimeZone.php';
84include_once './Services/Init/classes/class.ilIniFile.php';
85$ini = new ilIniFile(ILIAS_ABSOLUTE_PATH . '/ilias.ini.php');
86$ini->read();
87$DIC["ini"] = function ($c) {
88 return $GLOBALS["ini"];
89};
90
92define('IL_TIMEZONE', $tz);
93$DIC["tz"] = function ($c) {
94 return $GLOBALS["tz"];
95};
96
97define("TPLPATH", "./templates/blueshadow");
98
99// init session
101$DIC["sess"] = function ($c) {
102 return $GLOBALS["sess"];
103};
104
105$lang = (isset($_GET["lang"])) ? $_GET["lang"] : $_SESSION["lang"];
106
107$_SESSION["lang"] = $lang;
108
109// init languages
111$DIC["lng"] = function ($c) {
112 return $GLOBALS["lng"];
113};
114
115include_once './Services/Logging/classes/class.ilLoggingSetupSettings.php';
117$logging_settings->init();
118
119include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
121$log = $loggerFactory->getComponentLogger('setup');
122
124$DIC["ilLog"] = function ($c) {
125 return $GLOBALS["ilLog"];
126};
127$DIC["ilLoggerFactory"] = function ($c) use ($loggerFactory) {
128 return $loggerFactory;
129};
130
131// init template - in the main program please use ILIAS Template class
132// instantiate main template
133//$tpl = new ilTemplate("./setup/templates");
134//$tpl->loadTemplatefile("tpl.main.html", true, true);
135$tpl = new ilTemplate("tpl.main.html", true, true, "setup");
136$DIC["tpl"] = function ($c) {
137 return $GLOBALS["tpl"];
138};
139
140// make instance of structure reader
142$DIC["ilCtrlStructureReader"] = function ($c) {
143 return $GLOBALS["ilCtrlStructureReader"];
144};
145
146require_once "./Services/Utilities/classes/class.ilBenchmark.php";
148$GLOBALS['ilBench'] = $ilBench;
149$DIC["ilBench"] = function ($c) {
150 return $GLOBALS["ilBench"];
151};
152
153include_once("./Services/Database/classes/class.ilDBAnalyzer.php");
154include_once("./Services/Database/classes/class.ilMySQLAbstraction.php");
155include_once("./Services/Database/classes/class.ilDBGenerator.php");
156
157// HTTP Services
158$DIC['http.request_factory'] = function ($c) {
159 return new \ILIAS\HTTP\Request\RequestFactoryImpl();
160};
161
162$DIC['http.response_factory'] = function ($c) {
163 return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
164};
165
166$DIC['http.cookie_jar_factory'] = function ($c) {
167 return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
168};
169
170$DIC['http.response_sender_strategy'] = function ($c) {
171 return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
172};
173$DIC["http"] = function ($c) {
174 return new \ILIAS\DI\HTTPServices(
175 $c['http.response_sender_strategy'],
176 $c['http.cookie_jar_factory'],
177 $c['http.request_factory'],
178 $c['http.response_factory']
179 );
180};
181
182// UI Services
184$c["ui.factory"] = function ($c) {
186 $c["ui.factory.counter"],
187 $c["ui.factory.glyph"],
188 $c["ui.factory.button"],
189 $c["ui.factory.listing"],
190 $c["ui.factory.image"],
191 $c["ui.factory.panel"],
192 $c["ui.factory.modal"],
193 $c["ui.factory.dropzone"],
194 $c["ui.factory.popover"],
195 $c["ui.factory.divider"],
196 $c["ui.factory.link"],
197 $c["ui.factory.dropdown"],
198 $c["ui.factory.item"],
199 $c["ui.factory.icon"],
200 $c["ui.factory.viewcontrol"],
201 $c["ui.factory.chart"],
202 $c["ui.factory.input"],
203 $c["ui.factory.table"],
204 $c["ui.factory.messagebox"],
205 $c["ui.factory.card"]
206 );
207};
208$c["ui.signal_generator"] = function ($c) {
210};
211$c["ui.factory.counter"] = function ($c) {
213};
214$c["ui.factory.glyph"] = function ($c) {
216};
217$c["ui.factory.button"] = function ($c) {
219};
220$c["ui.factory.listing"] = function ($c) {
222};
223$c["ui.factory.image"] = function ($c) {
225};
226$c["ui.factory.panel"] = function ($c) {
227 return new ILIAS\UI\Implementation\Component\Panel\Factory($c["ui.factory.panel.listing"]);
228};
229$c["ui.factory.modal"] = function ($c) {
230 return new ILIAS\UI\Implementation\Component\Modal\Factory($c["ui.signal_generator"]);
231};
232$c["ui.factory.dropzone"] = function ($c) {
233 return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
234};
235$c["ui.factory.popover"] = function ($c) {
236 return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
237};
238$c["ui.factory.divider"] = function ($c) {
240};
241$c["ui.factory.link"] = function ($c) {
243};
244$c["ui.factory.dropdown"] = function ($c) {
246};
247$c["ui.factory.item"] = function ($c) {
249};
250$c["ui.factory.icon"] = function ($c) {
252};
253$c["ui.factory.viewcontrol"] = function ($c) {
254 return new ILIAS\UI\Implementation\Component\ViewControl\Factory($c["ui.signal_generator"]);
255};
256$c["ui.factory.chart"] = function ($c) {
257 return new ILIAS\UI\Implementation\Component\Chart\Factory($c["ui.factory.progressmeter"]);
258};
259$c["ui.factory.input"] = function ($c) {
261 $c["ui.signal_generator"],
262 $c["ui.factory.input.field"],
263 $c["ui.factory.input.container"]
264 );
265};
266$c["ui.factory.table"] = function ($c) {
267 return new ILIAS\UI\Implementation\Component\Table\Factory($c["ui.signal_generator"]);
268};
269$c["ui.factory.messagebox"] = function ($c) {
271};
272$c["ui.factory.card"] = function ($c) {
274};
275$c["ui.factory.progressmeter"] = function ($c) {
277};
278$c["ui.factory.dropzone.file"] = function ($c) {
280};
281$c["ui.factory.input.field"] = function ($c) {
282 $data_factory = new ILIAS\Data\Factory();
283 $validation_factory = new ILIAS\Validation\Factory($data_factory, $c["lng"]);
284 $transformation_factory = new ILIAS\Transformation\Factory();
286 $c["ui.signal_generator"],
287 $data_factory,
288 $validation_factory,
289 $transformation_factory
290 );
291};
292$c["ui.factory.input.container"] = function ($c) {
294 $c["ui.factory.input.container.form"]
295 );
296};
297$c["ui.factory.input.container.form"] = function ($c) {
299 $c["ui.factory.input.field"]
300 );
301};
302$c["ui.factory.panel.listing"] = function ($c) {
304};
305
306$c["ui.renderer"] = function ($c) {
308 $c["ui.component_renderer_loader"]
309 );
310};
311$c["ui.component_renderer_loader"] = function ($c) {
313 new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
314 $c["ui.resource_registry"],
315 new ILIAS\UI\Implementation\Render\FSLoader(
316 new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
317 $c["ui.factory"],
318 $c["ui.template_factory"],
319 $c["lng"],
320 $c["ui.javascript_binding"]
321 ),
322 new ILIAS\UI\Implementation\Component\Glyph\GlyphRendererFactory(
323 $c["ui.factory"],
324 $c["ui.template_factory"],
325 $c["lng"],
326 $c["ui.javascript_binding"]
327 )
328 )
329 )
330 );
331};
332$c["ui.template_factory"] = function ($c) {
334 $c["tpl"]
335 );
336};
337$c["ui.resource_registry"] = function ($c) {
339};
340$c["ui.javascript_binding"] = function ($c) {
342};
343
344
345// Other Services
346$DIC['ilCtrl'] = new ilCtrl();
347
348$DIC["ilIliasIniFile"] = function ($c) {
349 return $GLOBALS["ilIliasIniFile"];
350};
351
352$DIC["ilClientIniFile"] = function ($c) {
353 return $GLOBALS["ilClientIniFile"];
354};
355
356$DIC["global_screen"] = function () use ($DIC) {
357 return new Services(new ilGSProviderFactory($DIC));
358};
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Builds data types.
Definition: Factory.php:15
Factory for basic transformations.
Definition: Factory.php:12
Implementation of factory for cards.
Definition: Factory.php:13
Implementation of factory for tables.
Definition: Factory.php:13
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
Caches renderers loaded by another loader.
Wraps global ilTemplate to provide JavaScriptBinding.
"Manueller" Session-Fallback mit PHP4
performance measurement class
Class ilCtrlStructureReader.
This class provides processing control methods.
Class ilGSProviderFactory.
INIFile Parser.
language handling
static newInstance(ilLoggingSettings $settings)
get new instance
Logger settings for setup.
special template class to simplify handling of ITX/PEAR
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
$GLOBALS['ilBench']
$loggerFactory
$logging_settings
$_SESSION["lang"]
$ilCtrlStructureReader
This is how a factory for buttons looks like.
Definition: Factory.php:13
This is how the factory for UI elements looks.
Definition: Factory.php:16
Class BaseForm.
Class ilCertificateAppEventListener.
Class Factory.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']