/+junk/StupidMVC

To get this branch, use:
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
/*
7 by Gustav Hartvigsson
* a few more functions...
6
 * StupidMVC, The stupidly designed
1 by Gustav Hartvigsson
* initial code
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
13 by Gustav Hatvigsson
* Made the WelcomeView.php use functions for different parts of the
25
define ("BASE_URL", ("http://" . $_SERVER["SERVER_NAME"] . "/StupidMVC/"));
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
26
27
header("Content-type: text/xml");
28
3 by Gustav Hatvigsson
* Made the router a class
29
/* *****************************************************************************
1 by Gustav Hartvigsson
* initial code
30
 * ************************************************************************** */
31
2 by Gustav Hartvigsson
* a few changes.
32
33
/* The system wide definitions. */
1 by Gustav Hartvigsson
* initial code
34
define ("DS", DIRECTORY_SEPARATOR);
35
define ("ROOT_DIR", dirname(__FILE__) . DS);
36
define ("COMMON_DIR", ROOT_DIR . "Common" . DS);
37
define ("APP_DIR", ROOT_DIR . "Application" . DS);
38
2 by Gustav Hartvigsson
* a few changes.
39
/* Load in the common files. */
1 by Gustav Hartvigsson
* initial code
40
foreach (glob(COMMON_DIR . "*.php") as $php_file) {
41
  require ($php_file);
42
}
43
3 by Gustav Hatvigsson
* Made the router a class
44
$router = new Router ();
45
46
/*
47
 * Add controllers here.
7 by Gustav Hartvigsson
* a few more functions...
48
 *
3 by Gustav Hatvigsson
* Made the router a class
49
 */
50
$router->register_default_controller ("Welcome");
51
4 by Gustav Hatvigsson
* Added FourOhFour.php
52
$router->register_404_controller ("FourOhFour");
53
3 by Gustav Hatvigsson
* Made the router a class
54
$router->route();
55
56
1 by Gustav Hartvigsson
* initial code
57