bzr branch
http://gegoxaren.bato24.eu/bzr/%2Bjunk/StupidMVC
1
by Gustav Hartvigsson
* initial code |
1 |
<?php
|
2 |
||
2
by Gustav Hartvigsson
* a few changes. |
3 |
session_start(); |
4 |
||
5 |
/*
|
|
1
by Gustav Hartvigsson
* initial code |
6 |
* StupidMVC, The stupidly designed
|
7 |
*/
|
|
8 |
||
9 |
||
2
by Gustav Hartvigsson
* a few changes. |
10 |
/*
|
1
by Gustav Hartvigsson
* initial code |
11 |
* Set to FALSE to turn off errors.
|
12 |
*/
|
|
13 |
define ("DISPLAY_ERROR", TRUE); |
|
14 |
if (DISPLAY_ERROR) { |
|
2
by Gustav Hartvigsson
* a few changes. |
15 |
ini_set ('display_startup_errors', 1); |
16 |
ini_set ('display_errors', 1); |
|
1
by Gustav Hartvigsson
* initial code |
17 |
error_reporting(-1); |
2
by Gustav Hartvigsson
* a few changes. |
18 |
} else { |
19 |
ini_set ('display_startup_errors', 0); |
|
20 |
ini_set ('display_errors', 0); |
|
21 |
error_reporting(0); |
|
1
by Gustav Hartvigsson
* initial code |
22 |
}
|
23 |
||
3
by Gustav Hatvigsson
* Made the router a class |
24 |
|
25 |
/* *****************************************************************************
|
|
1
by Gustav Hartvigsson
* initial code |
26 |
* ************************************************************************** */
|
27 |
||
2
by Gustav Hartvigsson
* a few changes. |
28 |
|
29 |
/* The system wide definitions. */
|
|
1
by Gustav Hartvigsson
* initial code |
30 |
define ("DS", DIRECTORY_SEPARATOR); |
31 |
define ("ROOT_DIR", dirname(__FILE__) . DS); |
|
32 |
define ("COMMON_DIR", ROOT_DIR . "Common" . DS); |
|
33 |
define ("APP_DIR", ROOT_DIR . "Application" . DS); |
|
34 |
||
2
by Gustav Hartvigsson
* a few changes. |
35 |
/* Load in the common files. */
|
1
by Gustav Hartvigsson
* initial code |
36 |
foreach (glob(COMMON_DIR . "*.php") as $php_file) { |
37 |
require ($php_file); |
|
38 |
}
|
|
39 |
||
3
by Gustav Hatvigsson
* Made the router a class |
40 |
$router = new Router (); |
41 |
||
42 |
/*
|
|
43 |
* Add controllers here.
|
|
4
by Gustav Hatvigsson
* Added FourOhFour.php |
44 |
*
|
3
by Gustav Hatvigsson
* Made the router a class |
45 |
*/
|
46 |
$router->register_default_controller ("Welcome"); |
|
47 |
||
4
by Gustav Hatvigsson
* Added FourOhFour.php |
48 |
$router->register_404_controller ("FourOhFour"); |
49 |
||
5
by Gustav Hatvigsson
* changed a few small things |
50 |
var_dump ($router); |
51 |
||
3
by Gustav Hatvigsson
* Made the router a class |
52 |
$router->route(); |
53 |
||
54 |
||
1
by Gustav Hartvigsson
* initial code |
55 |