-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
59 lines (45 loc) · 1.31 KB
/
index.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
53
54
55
56
57
58
59
<?php
$input = array_merge($_GET, $_POST);
$DEBUG = false || isset($input['debug']);
$SQL_DEBUG = false || isset($input['sqldebug']);
/* Debug Classes */
require "ChromePhp.php"; // debugging
/* Utility Classes */
require "base/class.superutility.php";
require "class.user.php";
/* Functional Classes */
require "class.connect.php";
require "class.controller.php";
require "class.model.php";
require "class.view.php";
require "class.termin.php";
require "class.coverLesson.php";
require "class.newsletter.php";
/* Settings */
\ChromePhp::setEnabled($DEBUG);
ChromePhp::setSQLDebug($SQL_DEBUG);
if ($DEBUG) {
ini_set("display_errors", true);
enableCustomErrorHandler();
}
date_default_timezone_set('Europe/Berlin'); // if not corretly set in php.ini
/* Let's go! */
session_start();
if (isset($input['destroy'])) {
session_destroy();
header("Location: /");
}
$control = new Controller($input);
/**
* This function will throw Exceptions instead of warnings (better to debug)
*/
function enableCustomErrorHandler() {
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
// error was suppressed with the @-operator
if (0 === error_reporting()) {
return false;
}
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});
}
?>