forked from eventum/eventum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
52 lines (40 loc) · 1.36 KB
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
* This file is part of the Eventum (Issue Tracking System) package.
*
* @copyright (c) Eventum Team
* @license GNU General Public License, version 2 or later (GPL-2+)
*
* For the full copyright and license information,
* please see the COPYING and AUTHORS files
* that were distributed with this source code.
*/
use Eventum\Event\SystemEvents;
use Eventum\ServiceContainer;
require_once __DIR__ . '/autoload.php';
if (PHP_SAPI === 'cli' && Setup::needsSetup()) {
throw new RuntimeException('Eventum is not configured, setup file is missing');
}
// setup change some PHP settings
ini_set('memory_limit', '512M');
// prevent session from messing up the browser cache
ini_set('session.cache_limiter', 'nocache');
Misc::stripInput($_POST);
// set default timezone
date_default_timezone_set(Setup::getDefaultTimezone());
Language::setup();
// set charset
header('Content-Type: text/html; charset=UTF-8');
// display maintenance message if requested.
if (Setup::isMaintenance()) {
$is_manage = (strpos($_SERVER['PHP_SELF'], '/manage/') !== false);
if (!$is_manage) {
$tpl = new Template_Helper();
$tpl->setTemplate('maintenance.tpl.html');
$tpl->displayTemplate();
exit(0);
}
}
Eventum\DebugBarManager::getDebugBarManager();
ServiceContainer::getExtensionManager()->boot();
ServiceContainer::dispatch(SystemEvents::BOOT);