<?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();



