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
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) {
64  return $GLOBALS["ilErr"];
65 };
66 
67 // set ilias pathes
68 if ($_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?
76 if (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
90 include_once './Services/Calendar/classes/class.ilTimeZone.php';
91 include_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 
99 define('IL_TIMEZONE', $tz);
100 $DIC["tz"] = function ($c) {
101  return $GLOBALS["tz"];
102 };
103 
104 define("TPLPATH", "./templates/blueshadow");
105 
106 // init session
107 $sess = new 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 
122 include_once './Services/Logging/classes/class.ilLoggingSetupSettings.php';
124 $logging_settings->init();
125 
126 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
127 
128 $log = ilLoggerFactory::newInstance($logging_settings)->getComponentLogger('setup');
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 
150 require_once "./Services/Utilities/classes/class.ilBenchmark.php";
152 $GLOBALS['ilBench'] = $ilBench;
153 $DIC["ilBench"] = function ($c) {
154  return $GLOBALS["ilBench"];
155 };
156 
157 include_once("./Services/Database/classes/class.ilDBAnalyzer.php");
158 include_once("./Services/Database/classes/class.ilMySQLAbstraction.php");
159 include_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();
$logging_settings
This class provides processing control methods.
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.