ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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
35 
36 error_reporting(((int) (ini_get("error_reporting")) & ~E_NOTICE) & ~E_DEPRECATED);
37 
38 require_once __DIR__ . "/../../libs/composer/vendor/autoload.php";
39 
40 $DIC = new \ILIAS\DI\Container();
41 
42 define("DEBUG", false);
43 
44 //require_once "./Services/UICore/classes/class.ilTemplateHTMLITX.php";
45 require_once "./setup/classes/class.ilTemplate.php"; // modified class. needs to be merged with base template class
46 require_once "./Services/Logging/classes/class.ilLog.php";
47 require_once "./Services/Authentication/classes/class.ilSession.php";
48 require_once "./Services/Utilities/classes/class.ilUtil.php";
49 require_once "./Services/Init/classes/class.ilIniFile.php";
50 require_once "./setup/classes/class.ilSetupGUI.php";
51 require_once "./setup/classes/class.Session.php";
52 require_once "./setup/classes/class.ilClientList.php";
53 require_once "./setup/classes/class.ilClient.php";
54 require_once "./Services/FileSystem/classes/class.ilFile.php";
55 require_once "./Services/UICore/classes/Setup/class.ilCtrlStructureReader.php";
56 require_once "./Services/Xml/classes/class.ilSaxParser.php";
57 require_once "./include/inc.ilias_version.php";
58 include_once './Services/Logging/classes/public/class.ilLogLevel.php';
59 
60 // set ilias pathes
61 if ($_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?
69 if (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
83 include_once './Services/Calendar/classes/class.ilTimeZone.php';
84 include_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 
92 define('IL_TIMEZONE', $tz);
93 $DIC["tz"] = function ($c) {
94  return $GLOBALS["tz"];
95 };
96 
97 define("TPLPATH", "./templates/blueshadow");
98 
99 // init session
100 $sess = new 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 
115 include_once './Services/Logging/classes/class.ilLoggingSetupSettings.php';
117 $logging_settings->init();
118 
119 include_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 
146 require_once "./Services/Utilities/classes/class.ilBenchmark.php";
148 $GLOBALS['ilBench'] = $ilBench;
149 $DIC["ilBench"] = function ($c) {
150  return $GLOBALS["ilBench"];
151 };
152 
153 // HTTP Services
154 $DIC['http.request_factory'] = function ($c) {
155  return new \ILIAS\HTTP\Request\RequestFactoryImpl();
156 };
157 
158 $DIC['http.response_factory'] = function ($c) {
159  return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
160 };
161 
162 $DIC['http.cookie_jar_factory'] = function ($c) {
163  return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
164 };
165 
166 $DIC['http.response_sender_strategy'] = function ($c) {
167  return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
168 };
169 $DIC["http"] = function ($c) {
170  return new \ILIAS\DI\HTTPServices(
171  $c['http.response_sender_strategy'],
172  $c['http.cookie_jar_factory'],
173  $c['http.request_factory'],
174  $c['http.response_factory']
175  );
176 };
177 
178 // UI Services
180 $c["ui.factory"] = function ($c) {
182  $c["ui.factory.counter"],
183  $c["ui.factory.button"],
184  $c["ui.factory.listing"],
185  $c["ui.factory.image"],
186  $c["ui.factory.panel"],
187  $c["ui.factory.modal"],
188  $c["ui.factory.dropzone"],
189  $c["ui.factory.popover"],
190  $c["ui.factory.divider"],
191  $c["ui.factory.link"],
192  $c["ui.factory.dropdown"],
193  $c["ui.factory.item"],
194  $c["ui.factory.viewcontrol"],
195  $c["ui.factory.chart"],
196  $c["ui.factory.input"],
197  $c["ui.factory.table"],
198  $c["ui.factory.messagebox"],
199  $c["ui.factory.card"],
200  $c["ui.factory.layout"],
201  $c["ui.factory.maincontrols"],
202  $c["ui.factory.tree"],
203  $c["ui.factory.menu"],
204  $c["ui.factory.symbol"],
205  $c["ui.factory.legacy"]
206  );
207 };
208 $c["ui.signal_generator"] = function ($c) {
210 };
211 $c["ui.factory.counter"] = function ($c) {
213 };
214 $c["ui.factory.symbol.glyph"] = function ($c) {
216 };
217 $c["ui.factory.symbol.icon"] = function ($c) {
219 };
220 $c["ui.factory.symbol"] = function ($c) {
222  $c["ui.factory.symbol.icon"],
223  $c["ui.factory.symbol.glyph"]
224  );
225 };
226 $c["ui.factory.button"] = function ($c) {
228 };
229 $c["ui.factory.listing"] = function ($c) {
231 };
232 $c["ui.factory.image"] = function ($c) {
234 };
235 $c["ui.factory.panel"] = function ($c) {
236  return new ILIAS\UI\Implementation\Component\Panel\Factory($c["ui.factory.panel.listing"]);
237 };
238 $c["ui.factory.modal"] = function ($c) {
239  return new ILIAS\UI\Implementation\Component\Modal\Factory($c["ui.signal_generator"]);
240 };
241 $c["ui.factory.dropzone"] = function ($c) {
242  return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
243 };
244 $c["ui.factory.popover"] = function ($c) {
245  return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
246 };
247 $c["ui.factory.divider"] = function ($c) {
249 };
250 $c["ui.factory.link"] = function ($c) {
252 };
253 $c["ui.factory.dropdown"] = function ($c) {
255 };
256 $c["ui.factory.item"] = function ($c) {
258 };
259 
260 $c["ui.factory.viewcontrol"] = function ($c) {
261  return new ILIAS\UI\Implementation\Component\ViewControl\Factory($c["ui.signal_generator"]);
262 };
263 $c["ui.factory.chart"] = function ($c) {
264  return new ILIAS\UI\Implementation\Component\Chart\Factory($c["ui.factory.progressmeter"]);
265 };
266 $c["ui.factory.input"] = function ($c) {
268  $c["ui.signal_generator"],
269  $c["ui.factory.input.field"],
270  $c["ui.factory.input.container"]
271  );
272 };
273 $c["ui.factory.table"] = function ($c) {
274  return new ILIAS\UI\Implementation\Component\Table\Factory($c["ui.signal_generator"]);
275 };
276 $c["ui.factory.messagebox"] = function ($c) {
278 };
279 $c["ui.factory.card"] = function ($c) {
281 };
282 $c["ui.factory.layout"] = function ($c) {
284 };
285 $c["ui.factory.maincontrols.slate"] = function ($c) {
287  $c['ui.signal_generator'],
288  $c['ui.factory.counter']
289  );
290 };
291 $c["ui.factory.maincontrols"] = function ($c) {
293  $c['ui.signal_generator'],
294  $c['ui.factory.maincontrols.slate']
295  );
296 };
297 $c["ui.factory.menu"] = function ($c) {
299 };
300 
301 $c["ui.factory.tree"] = function ($c) {
302  return new ILIAS\UI\Implementation\Component\Tree\Factory($c["ui.signal_generator"]);
303 };
304 $c["ui.factory.progressmeter"] = function ($c) {
306 };
307 $c["ui.factory.dropzone.file"] = function ($c) {
309 };
310 $c["ui.factory.input.field"] = function ($c) {
311  $data_factory = new ILIAS\Data\Factory();
312  $refinery = new ILIAS\Refinery\Factory($data_factory, $c["lng"]);
314  $c["ui.signal_generator"],
315  $data_factory,
316  $refinery
317  );
318 };
319 $c["ui.factory.input.container"] = function ($c) {
321  $c["ui.factory.input.container.form"],
322  $c["ui.factory.input.container.filter"]
323  );
324 };
325 $c["ui.factory.input.container.filter"] = function ($c) {
327  $c["ui.signal_generator"],
328  $c["ui.factory.input.field"]
329  );
330 };
331 $c["ui.factory.input.container.form"] = function ($c) {
333  $c["ui.factory.input.field"]
334  );
335 };
336 $c["ui.factory.panel.listing"] = function ($c) {
338 };
339 $c["ui.factory.legacy"] = function ($c) {
340  return new ILIAS\UI\Implementation\Component\Legacy\Factory($c["ui.signal_generator"]);
341 };
342 
343 $c["ui.renderer"] = function ($c) {
345  $c["ui.component_renderer_loader"]
346  );
347 };
348 $c["ui.component_renderer_loader"] = function ($c) {
350  new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
351  $c["ui.resource_registry"],
352  new ILIAS\UI\Implementation\Render\FSLoader(
353  new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
354  $c["ui.factory"],
355  $c["ui.template_factory"],
356  $c["lng"],
357  $c["ui.javascript_binding"]
358  ),
359  new ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphRendererFactory(
360  $c["ui.factory"],
361  $c["ui.template_factory"],
362  $c["lng"],
363  $c["ui.javascript_binding"]
364  ),
365  new ILIAS\UI\Implementation\Component\Input\Field\FieldRendererFactory(
366  $c["ui.factory"],
367  $c["ui.template_factory"],
368  $c["lng"],
369  $c["ui.javascript_binding"]
370  )
371  )
372  )
373  );
374 };
375 $c["ui.template_factory"] = function ($c) {
377  $c["tpl"]
378  );
379 };
380 $c["ui.resource_registry"] = function ($c) {
382 };
383 $c["ui.javascript_binding"] = function ($c) {
385 };
386 
387 // Global Screen
388 $c['global_screen'] = function () use ($c) {
389  return new Services(new NullProviderFactory());
390 };
391 
392 
393 // Other Services
394 $DIC['ilCtrl'] = new ilCtrl();
395 
396 $DIC["ilIliasIniFile"] = function ($c) {
397  return $GLOBALS["ilIliasIniFile"];
398 };
399 
400 $DIC["ilClientIniFile"] = function ($c) {
401  return $GLOBALS["ilClientIniFile"];
402 };
$logging_settings
This class provides processing control methods.
Class Factory.
$_GET["client_id"]
static newInstance(ilLoggingSettings $settings)
get new instance
Class ChatMainBarProvider .
Wraps global ilTemplate to provide JavaScriptBinding.
$ilCtrlStructureReader
Implementation of factory for tables.
Definition: Factory.php:12
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
$_SESSION["lang"]
language handling for setup
Class ilCtrlStructureReader.
$GLOBALS['ilBench']
Implementation of factory for cards.
Definition: Factory.php:12
Logger settings for setup.
This is how the factory for UI elements looks.
Definition: Factory.php:17
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
Builds data types.
Definition: Factory.php:19
"Manueller" Session-Fallback mit PHP4
This is how a factory for filters looks like.
Definition: Factory.php:13
performance measurement class
This is what a factory for layouts looks like.
Definition: Factory.php:8
INIFile Parser.
This is how a factory for buttons looks like.
Definition: Factory.php:12
Class ilAsqQuestionAuthoringFactory.
$loggerFactory