2011-12-27 13:24:28 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Change this in a live environment!
|
2012-01-04 19:47:32 -05:00
|
|
|
error_reporting((-1) & ~(E_ERROR | E_PARSE));
|
2011-12-27 13:24:28 -05:00
|
|
|
|
|
|
|
// Set the default paths
|
2012-01-03 21:54:09 -05:00
|
|
|
define('BASE_PATH', __DIR__);
|
2011-12-27 13:24:28 -05:00
|
|
|
define('SYS_PATH', __DIR__.'/sys/');
|
|
|
|
define('MOD_PATH', __DIR__.'/modules/');
|
|
|
|
define('APP_PATH', __DIR__.'/app/');
|
|
|
|
|
2011-12-29 16:57:28 -05:00
|
|
|
$ri = $_SERVER['REQUEST_URI'];
|
2011-12-30 16:41:25 -05:00
|
|
|
$ind_pos = stripos($ri, "index.php");
|
2011-12-29 16:57:28 -05:00
|
|
|
$default_path = ($ind_pos !== FALSE) ? substr($ri, 0, $ind_pos) : $ri;
|
2011-12-30 16:41:25 -05:00
|
|
|
$default_baseurl = "//" . str_replace("//", "/", $_SERVER['HTTP_HOST']. $default_path);
|
2011-12-29 10:31:04 -05:00
|
|
|
|
|
|
|
// Require the basic configuratio file
|
|
|
|
require(APP_PATH.'config/config.php');
|
|
|
|
|
2011-12-27 13:24:28 -05:00
|
|
|
// Require the most important files
|
2011-12-27 16:47:27 -05:00
|
|
|
require(SYS_PATH . "common.php");
|
2011-12-27 13:24:28 -05:00
|
|
|
|
2012-01-05 16:31:50 -05:00
|
|
|
//Set error handlers
|
|
|
|
register_shutdown_function('shutdown');
|
|
|
|
set_error_handler('on_error');
|
|
|
|
set_exception_handler('on_exception');
|
|
|
|
|
|
|
|
// And away we go!
|
|
|
|
route();
|