ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
33error_reporting((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED);
34
35require_once __DIR__ . "/../../libs/composer/vendor/autoload.php";
36
37$DIC = new \ILIAS\DI\Container();
38
39define("DEBUG", false);
40
41//require_once "./Services/UICore/classes/class.ilTemplateHTMLITX.php";
42require_once "./setup/classes/class.ilTemplate.php"; // modified class. needs to be merged with base template class
43require_once "./setup/classes/class.ilLanguage.php"; // modified class. needs to be merged with base language class
44require_once "./Services/Logging/classes/class.ilLog.php";
45require_once "./Services/Authentication/classes/class.ilSession.php";
46require_once "./Services/Utilities/classes/class.ilUtil.php";
47require_once "./Services/Init/classes/class.ilIniFile.php";
48require_once "./setup/classes/class.ilSetupGUI.php";
49require_once "./setup/classes/class.Session.php";
50require_once "./setup/classes/class.ilClientList.php";
51require_once "./setup/classes/class.ilClient.php";
52require_once "./Services/FileSystem/classes/class.ilFile.php";
53require_once "./setup/classes/class.ilCtrlStructureReader.php";
54require_once "./Services/Xml/classes/class.ilSaxParser.php";
55require_once "./include/inc.ilias_version.php";
56include_once './Services/Logging/classes/public/class.ilLogLevel.php';
57
58// include error_handling
59require_once "./setup/classes/class.ilSetupErrorHandling.php";
60
62$ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr,'errorHandler'));
63$DIC["ilErr"] = function ($c) {
64 return $GLOBALS["ilErr"];
65};
66
67// set ilias pathes
68if ($_SERVER['HTTPS'] == 'on') {
69 define("ILIAS_HTTP_PATH", substr("https://" . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]), 0, -6));
70} else {
71 define("ILIAS_HTTP_PATH", substr("http://" . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]), 0, -6));
72}
73
74
75// PHP is running in CGI mode?
76if (isset($_SERVER["REDIRECT_STATUS"]) && !isset($_SERVER["FCGI_ROLE"])) {
77 if ($_SERVER["PATH_TRANSLATED"] != "") {
78 define("ILIAS_ABSOLUTE_PATH", substr(dirname($_SERVER["PATH_TRANSLATED"]), 0, -6));
79 } else {
80 define("ILIAS_ABSOLUTE_PATH", substr(dirname($_SERVER["SCRIPT_FILENAME"]), 0, -6));
81 }
82} elseif ($_SERVER["SCRIPT_FILENAME"] != "") {
83 define("ILIAS_ABSOLUTE_PATH", substr(dirname($_SERVER["SCRIPT_FILENAME"]), 0, -6));
84} else {
85 // included this due to http://education2news.blogspot.com.es/2012/06/installing-ilias-424.html
86 define('ILIAS_ABSOLUTE_PATH', str_replace("/setup/include", "", dirname(__FILE__)));
87}
88
89// set default timezone
90include_once './Services/Calendar/classes/class.ilTimeZone.php';
91include_once './Services/Init/classes/class.ilIniFile.php';
92$ini = new ilIniFile(ILIAS_ABSOLUTE_PATH . '/ilias.ini.php');
93$ini->read();
94$DIC["ini"] = function ($c) {
95 return $GLOBALS["ini"];
96};
97
99define('IL_TIMEZONE', $tz);
100$DIC["tz"] = function ($c) {
101 return $GLOBALS["tz"];
102};
103
104define("TPLPATH", "./templates/blueshadow");
105
106// init session
108$DIC["sess"] = function ($c) {
109 return $GLOBALS["sess"];
110};
111
112$lang = (isset($_GET["lang"])) ? $_GET["lang"] : $_SESSION["lang"];
113
114$_SESSION["lang"] = $lang;
115
116// init languages
118$DIC["lng"] = function ($c) {
119 return $GLOBALS["lng"];
120};
121
122include_once './Services/Logging/classes/class.ilLoggingSetupSettings.php';
124$logging_settings->init();
125
126include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
127
130$DIC["ilLog"] = function ($c) {
131 return $GLOBALS["ilLog"];
132};
133
134// init template - in the main program please use ILIAS Template class
135// instantiate main template
136//$tpl = new ilTemplate("./setup/templates");
137//$tpl->loadTemplatefile("tpl.main.html", true, true);
138$tpl = new ilTemplate("tpl.main.html", true, true, "setup");
139$DIC["tpl"] = function ($c) {
140 return $GLOBALS["tpl"];
141};
142
143// make instance of structure reader
145$ilCtrlStructureReader->setErrorObject($ilErr);
146$DIC["ilCtrlStructureReader"] = function ($c) {
147 return $GLOBALS["ilCtrlStructureReader"];
148};
149
150require_once "./Services/Utilities/classes/class.ilBenchmark.php";
152$GLOBALS['ilBench'] = $ilBench;
153$DIC["ilBench"] = function ($c) {
154 return $GLOBALS["ilBench"];
155};
156
157include_once("./Services/Database/classes/class.ilDBAnalyzer.php");
158include_once("./Services/Database/classes/class.ilMySQLAbstraction.php");
159include_once("./Services/Database/classes/class.ilDBGenerator.php");
160
161// HTTP Services
162$DIC['http.request_factory'] = function ($c) {
163 return new \ILIAS\HTTP\Request\RequestFactoryImpl();
164};
165
166$DIC['http.response_factory'] = function ($c) {
167 return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
168};
169
170$DIC['http.cookie_jar_factory'] = function ($c) {
171 return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
172};
173
174$DIC['http.response_sender_strategy'] = function ($c) {
175 return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
176};
177$DIC["http"] = function ($c) {
178 return new \ILIAS\DI\HTTPServices(
179 $c['http.response_sender_strategy'],
180 $c['http.cookie_jar_factory'],
181 $c['http.request_factory'],
182 $c['http.response_factory']
183 );
184};
185$DIC['ilCtrl'] = new ilCtrl();
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
"Manueller" Session-Fallback mit PHP4
performance measurement class
Class ilCtrlStructureReader.
This class provides processing control methods.
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']
$logging_settings
$_SESSION["lang"]
$ilCtrlStructureReader
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']