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
33 error_reporting((ini_get("error_reporting") & ~E_NOTICE) & ~E_DEPRECATED);
34 
35 require_once __DIR__."/../../libs/composer/vendor/autoload.php";
36 
37 $DIC = new \ILIAS\DI\Container();
38 
39 define("DEBUG",false);
40 
41 //require_once "./Services/UICore/classes/class.ilTemplateHTMLITX.php";
42 require_once "./setup/classes/class.ilTemplate.php"; // modified class. needs to be merged with base template class
43 require_once "./setup/classes/class.ilLanguage.php"; // modified class. needs to be merged with base language class
44 require_once "./Services/Logging/classes/class.ilLog.php";
45 require_once "./Services/Authentication/classes/class.ilSession.php";
46 require_once "./Services/Utilities/classes/class.ilUtil.php";
47 require_once "./Services/Init/classes/class.ilIniFile.php";
48 require_once "./setup/classes/class.ilSetupGUI.php";
49 require_once "./setup/classes/class.Session.php";
50 require_once "./setup/classes/class.ilClientList.php";
51 require_once "./setup/classes/class.ilClient.php";
52 require_once "./Services/FileSystem/classes/class.ilFile.php";
53 require_once "./setup/classes/class.ilCtrlStructureReader.php";
54 require_once "./Services/Xml/classes/class.ilSaxParser.php";
55 require_once "./include/inc.ilias_version.php";
56 include_once './Services/Logging/classes/public/class.ilLogLevel.php';
57 
58 // include error_handling
59 require_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
66 if($_SERVER['HTTPS'] == 'on')
67 {
68  define ("ILIAS_HTTP_PATH",substr("https://".$_SERVER["HTTP_HOST"].dirname($_SERVER["REQUEST_URI"]),0,-6));
69 }
70 else
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?
77 if (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 }
88 else if ($_SERVER["SCRIPT_FILENAME"] != "")
89 {
90  define ("ILIAS_ABSOLUTE_PATH",substr(dirname($_SERVER["SCRIPT_FILENAME"]),0,-6));
91 }
92 else
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
99 include_once './Services/Calendar/classes/class.ilTimeZone.php';
100 include_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 
106 define('IL_TIMEZONE',$tz);
107 $DIC["tz"] = function($c) { return $GLOBALS["tz"]; };
108 
109 define ("TPLPATH","./templates/blueshadow");
110 
111 // init session
112 $sess = new 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 
123 include_once './Services/Logging/classes/class.ilLoggingSetupSettings.php';
125 $logging_settings->init();
126 
127 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
128 
129 $log = ilLoggerFactory::newInstance($logging_settings)->getComponentLogger('setup');
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 
145 require_once "./Services/Utilities/classes/class.ilBenchmark.php";
147 $GLOBALS['ilBench'] = $ilBench;
148 $DIC["ilBench"] = function($c) { return $GLOBALS["ilBench"]; };
149 
150 include_once("./Services/Database/classes/class.ilDBAnalyzer.php");
151 include_once("./Services/Database/classes/class.ilMySQLAbstraction.php");
152 include_once("./Services/Database/classes/class.ilDBGenerator.php");
153 
154 ?>
$logging_settings
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
$_GET["client_id"]
static newInstance(ilLoggingSettings $settings)
get new instance
$ilCtrlStructureReader
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
$_SESSION["lang"]
Class ilCtrlStructureReader.
$GLOBALS['ilBench']
Logger settings for setup.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
"Manueller" Session-Fallback mit PHP4
performance measurement class
language handling
INIFile Parser.