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
|
<?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);
}
define ("BASE_URL", ("http://" . $_SERVER["SERVER_NAME"] . "/StupidMVC/"));
header("Content-type: text/xml");
/* *****************************************************************************
* ************************************************************************** */
/* 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);
}
$router = new Router ();
/*
* Add controllers here.
*
*/
$router->register_default_controller ("Welcome");
$router->register_404_controller ("FourOhFour");
$router->route();
|