Update index.php
This commit is contained in:
parent
af41bbc170
commit
fa1df12aa9
22
index.php
22
index.php
|
@ -3,7 +3,7 @@
|
|||
* @file index.php
|
||||
* @date 2017-12-18
|
||||
* @author Go Namhyeon <gnh1201@gmail.com>
|
||||
* @brief ReasonablePHPFramework
|
||||
* @brief VerySimplePHPFramework
|
||||
* @cvs http://github.com/gnh1201/verysimplephpframework
|
||||
*/
|
||||
|
||||
|
@ -13,11 +13,10 @@ ini_set("max_execution_time", 0);
|
|||
error_reporting(E_ALL);
|
||||
ini_set("display_errors", 1);
|
||||
|
||||
// including vendor autoloader
|
||||
include_once('./vendor/autoload.php');
|
||||
|
||||
// load system files
|
||||
// define system modules
|
||||
$load_systems = array('base', 'config', 'database', 'uri', 'logger', 'security');
|
||||
|
||||
// load system modules
|
||||
foreach($load_systems as $system_name) {
|
||||
$system_inc_file = './system/' . $system_name . '.php';
|
||||
if(file_exists($system_inc_file)) {
|
||||
|
@ -25,21 +24,24 @@ foreach($load_systems as $system_name) {
|
|||
}
|
||||
}
|
||||
|
||||
// autoload module
|
||||
if(array_key_empty('enable_autoload', $config)) {
|
||||
loadModule("autoload");
|
||||
}
|
||||
|
||||
// set timezone
|
||||
$default_timezone = array_key_empty("timezone", $config) ? $config['timezone'] : "UTC";
|
||||
date_default_timezone_set($default_timezone);
|
||||
|
||||
// start session (enable $_SESSION)
|
||||
session_start();
|
||||
|
||||
// route controller
|
||||
$route = '';
|
||||
if(array_key_exists('route', $_REQUEST)) {
|
||||
if(!array_key_empty('route', $_REQUEST)) {
|
||||
$route = $_REQUEST['route'];
|
||||
}
|
||||
|
||||
// load route
|
||||
if(empty($route)) {
|
||||
$route = 'index';
|
||||
$route = 'welcome';
|
||||
} else {
|
||||
$route_names = explode('/', $route);
|
||||
if(count($route) > 1) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user