-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
58 lines (46 loc) · 1.36 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
<?php
/*
* File index.php
* @Author : Quentin LOZACH
* @Version : 0.1
* @Page : index
* @Role : Link all the page and the structure to load the page the user wants
*/
// Defining PATH constants related to the project
define( 'BASE_PATH', dirname( realpath(__FILE__) ) );
define( 'CORE_PATH', BASE_PATH . '/core' );
define( 'CONFIG_PATH', BASE_PATH . '/configuration' );
define( 'APP_PATH', BASE_PATH . '/application' );
define( 'ASSETS_PATH', BASE_PATH . '/application/assets/' );
define( 'LIB_PATH', BASE_PATH . '/application/libraries/' );
define( 'MVC_PATH', BASE_PATH . '/application/mvc/' );
// Include constants
include CONFIG_PATH . '/constants/mode.php';
// Configuring error handler
switch ( APP_MODE ) {
case "development" :
case "testing" :
error_reporting( E_ALL );
break;
case "production" :
error_reporting( 0 );
break;
default:
error_reporting( E_ALL );
}
// Load the Router class
include BASE_PATH . '/core/router/router.php';
// Create an instance of a new page
if( !isset( $_GET['request'] ) ) {
Router::getInstance()->parseRequest();
}
else {
Router::getInstance()->parseRequest( $_GET['request'] );
}
// Calling the debug method for the structure creation
if( Router::getInstance()->getError() != TRUE ) {
Router::getInstance()->debug();
}
/* End of file index.php */
/* Location: ./index.php */
?>