-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.php
More file actions
35 lines (26 loc) · 653 Bytes
/
init.php
File metadata and controls
35 lines (26 loc) · 653 Bytes
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
<?php
spl_autoload_register(function($class)
{
if(file_exists(__DIR__."/app/model/{$class}.php"))
{
require_once __DIR__."/app/model/{$class}.php";
}
else
{
require_once __DIR__."/app/controllers/{$class}.php";
}
});
/**
* Enable/Disable Debugging
* Pass debug=1 as parameter in URL to enable, and see useful error messages
* Pass debug=0 as parameter to disable debugging
*/
if((isset($_GET['debug']) and $_GET['debug'] == 0))
{
session_unset($_SESSION['debug']);
}
if((isset($_GET['debug']) and $_GET['debug'] == 1) or $_SESSION['debug'] == 1)
{
$_SESSION['debug'] = 1;
require_once(__DIR__.'/app/debug/debugMode.php');
}