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
|
<?php
session_start();
/*
* StupidMVC, The stupidly designed
*/
/*
* Set to FALSE to turn off errors.
*/
define ("DISPLAY_ERROR", TRUE);
if (DISPLAY_ERROR) {
ini_set ('display_startup_errors', 1);
ini_set ('display_errors', 1);
error_reporting(-1);
} else {
ini_set ('display_startup_errors', 0);
ini_set ('display_errors', 0);
error_reporting(0);
}
/* ***************************************************************************
* Do not touch anything bellow this point.
* ************************************************************************** */
/* Load the cfg file */
global $_stupid_cfg = json_decode (file_get_contents ("./cfg.json"));
/* The system wide definitions. */
define ("DS", DIRECTORY_SEPARATOR);
define ("ROOT_DIR", dirname(__FILE__) . DS);
define ("COMMON_DIR", ROOT_DIR . "Common" . DS);
define ("APP_DIR", ROOT_DIR . "Application" . DS);
/* Load in the common files. */
foreach (glob(COMMON_DIR . "*.php") as $php_file) {
require ($php_file);
}
/* Run the router. */
_route ();
|