/+junk/StupidMVC

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/StupidMVC

« back to all changes in this revision

Viewing changes to index.php

  • Committer: Gustav Hartvigsson
  • Date: 2016-03-15 21:33:26 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160315213326-x8r9dj0dknv6jnl6
* a few changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
3
 
/**
 
3
session_start();
 
4
 
 
5
/*
4
6
 * StupidMVC, The stupidly designed 
5
7
 */
6
8
 
7
9
 
8
 
/**
 
10
/*
9
11
 * Set to FALSE to turn off errors.
10
12
 */
11
13
define ("DISPLAY_ERROR", TRUE);
12
14
if (DISPLAY_ERROR) {
13
 
  ini_set ('display_startup_errors',1);
14
 
  ini_set ('display_errors',1);
 
15
  ini_set ('display_startup_errors', 1);
 
16
  ini_set ('display_errors', 1);
15
17
  error_reporting(-1);
 
18
} else {
 
19
  ini_set ('display_startup_errors', 0);
 
20
  ini_set ('display_errors', 0);
 
21
  error_reporting(0);
16
22
}
17
23
 
18
24
/* ***************************************************************************
19
25
 * Do not touch anything bellow this point.
20
26
 * ************************************************************************** */
21
27
 
22
 
global $_stupid_cfg;
23
 
 
24
 
$_stupid_cfg = json_decode (file_get_contents ("./cfg.json"));
25
 
 
26
 
/**
27
 
 * The system wide definitions.
28
 
 */
 
28
/* Load the cfg file */
 
29
global $_stupid_cfg = json_decode (file_get_contents ("./cfg.json"));
 
30
 
 
31
/* The system wide definitions. */
29
32
define ("DS", DIRECTORY_SEPARATOR);
30
33
define ("ROOT_DIR", dirname(__FILE__) . DS);
31
34
define ("COMMON_DIR", ROOT_DIR . "Common" . DS);
32
35
define ("APP_DIR", ROOT_DIR . "Application" . DS);
33
36
 
 
37
/* Load in the common files. */
34
38
foreach (glob(COMMON_DIR . "*.php") as $php_file) {
35
39
  require ($php_file);
36
40
}
37
41
 
38
 
/* *****************************************************************************
39
 
 *
40
 
 * ************************************************************************** */
41
 
 
42
 
 
43
 
_rout ();
 
42
/* Run the router. */
 
43
_route ();
44
44