ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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) { return $GLOBALS["ilErr"]; };
64
65// set ilias pathes
66if($_SERVER['HTTPS'] == 'on')
67{
68 define ("ILIAS_HTTP_PATH",substr("https://".$_SERVER["HTTP_HOST"].dirname($_SERVER["REQUEST_URI"]),0,-6));
69}
70else
71{
72 define ("ILIAS_HTTP_PATH",substr("http://".$_SERVER["HTTP_HOST"].dirname($_SERVER["REQUEST_URI"]),0,-6));
73}
74
75
76// PHP is running in CGI mode?
77if (isset($_SERVER["REDIRECT_STATUS"]) && !isset($_SERVER["FCGI_ROLE"]))
78{
79 if ($_SERVER["PATH_TRANSLATED"] != "")
80 {
81 define ("ILIAS_ABSOLUTE_PATH",substr(dirname($_SERVER["PATH_TRANSLATED"]),0,-6));
82 }
83 else
84 {
85 define ("ILIAS_ABSOLUTE_PATH",substr(dirname($_SERVER["SCRIPT_FILENAME"]),0,-6));
86 }
87}
88else if ($_SERVER["SCRIPT_FILENAME"] != "")
89{
90 define ("ILIAS_ABSOLUTE_PATH",substr(dirname($_SERVER["SCRIPT_FILENAME"]),0,-6));
91}
92else
93{
94 // included this due to http://education2news.blogspot.com.es/2012/06/installing-ilias-424.html
95 define ('ILIAS_ABSOLUTE_PATH',str_replace("/setup/include", "", dirname(__FILE__)));
96}
97
98// set default timezone
99include_once './Services/Calendar/classes/class.ilTimeZone.php';
100include_once './Services/Init/classes/class.ilIniFile.php';
101$ini = new ilIniFile(ILIAS_ABSOLUTE_PATH.'/ilias.ini.php');
102$ini->read();
103$DIC["ini"] = function($c) { return $GLOBALS["ini"]; };
104
106define('IL_TIMEZONE',$tz);
107$DIC["tz"] = function($c) { return $GLOBALS["tz"]; };
108
109define ("TPLPATH","./templates/blueshadow");
110
111// init session
113$DIC["sess"] = function($c) { return $GLOBALS["sess"]; };
114
115$lang = (isset($_GET["lang"])) ? $_GET["lang"] : $_SESSION["lang"];
116
117$_SESSION["lang"] = $lang;
118
119// init languages
121$DIC["lng"] = function($c) { return $GLOBALS["lng"]; };
122
123include_once './Services/Logging/classes/class.ilLoggingSetupSettings.php';
125$logging_settings->init();
126
127include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
128
131$DIC["ilLog"] = function($c) { return $GLOBALS["ilLog"]; };
132
133// init template - in the main program please use ILIAS Template class
134// instantiate main template
135//$tpl = new ilTemplate("./setup/templates");
136//$tpl->loadTemplatefile("tpl.main.html", true, true);
137$tpl = new ilTemplate("tpl.main.html", true, true, "setup");
138$DIC["tpl"] = function($c) { return $GLOBALS["tpl"]; };
139
140// make instance of structure reader
142$ilCtrlStructureReader->setErrorObject($ilErr);
143$DIC["ilCtrlStructureReader"] = function($c) { return $GLOBALS["ilCtrlStructureReader"]; };
144
145require_once "./Services/Utilities/classes/class.ilBenchmark.php";
147$GLOBALS['ilBench'] = $ilBench;
148$DIC["ilBench"] = function($c) { return $GLOBALS["ilBench"]; };
149
150include_once("./Services/Database/classes/class.ilDBAnalyzer.php");
151include_once("./Services/Database/classes/class.ilMySQLAbstraction.php");
152include_once("./Services/Database/classes/class.ilDBGenerator.php");
153
154?>
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.
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']