-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
48 lines (45 loc) · 1.24 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
use Connection as GlobalConnection;
use FTP\Connection;
define('_DIR_ROOT', __DIR__);
/*
* Config HTTP root
*
* */
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
$web_root = 'https://' . $_SERVER['HTTP_HOST'];
}
else{
$web_root = 'http://' . $_SERVER['HTTP_HOST'];
}
/*
* Auto load config
*
* */
$config_dir = scandir('configs');
if(isset($config_dir)){
foreach($config_dir as $item){
if($item != '.' && $item != '..' && file_exists('configs/'.$item)){
require_once 'configs/'.$item;
}
}
}
require_once 'core/Route.php'; //Load Route class
require_once 'core/Session.php'; //Load Session
require_once 'app/App.php'; //Load app
if(!empty($config['database'])){
$db_config = array_filter($config['database']);
if(!empty($db_config)){
require_once 'core/Connection.php';
require_once 'core/QueryBuilder.php';
require_once 'core/Database.php';
require_once 'core/DB.php';
$db = new Database();
}
}
require_once 'core/Model.php';
require_once 'core/Controller.php'; //Load controller
require_once 'core/Request.php'; //Load Request
require_once 'core/Response.php'; //Load Response
require_once 'core/Function.php'; //Load Function
?>