/+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
/*
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
24
/* ***************************************************************************
25
 * Do not touch anything bellow this point.
26
 * ************************************************************************** */
27
2 by Gustav Hartvigsson
* a few changes.
28
/* Load the cfg file */
29
global $_stupid_cfg = json_decode (file_get_contents ("./cfg.json"));
30
31
/* The system wide definitions. */
1 by Gustav Hartvigsson
* initial code
32
define ("DS", DIRECTORY_SEPARATOR);
33
define ("ROOT_DIR", dirname(__FILE__) . DS);
34
define ("COMMON_DIR", ROOT_DIR . "Common" . DS);
35
define ("APP_DIR", ROOT_DIR . "Application" . DS);
36
2 by Gustav Hartvigsson
* a few changes.
37
/* Load in the common files. */
1 by Gustav Hartvigsson
* initial code
38
foreach (glob(COMMON_DIR . "*.php") as $php_file) {
39
  require ($php_file);
40
}
41
2 by Gustav Hartvigsson
* a few changes.
42
/* Run the router. */
43
_route ();
1 by Gustav Hartvigsson
* initial code
44