forked from orvice/ss-panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
executable file
·49 lines (39 loc) · 1.04 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
49
<?php
/***
* ss-panel v3 Bootstrap
* @author orvice
* @email sspanel@orx.me
* @url https://github.com/orvice/ss-panel
*/
use Illuminate\Database\Capsule\Manager as Capsule;
use Dotenv\Dotenv;
use App\Services\Config;
// BASE_PATH
define('BASE_PATH', __DIR__);
// Vendor Autoload
require BASE_PATH.'/vendor/autoload.php';
// Env
$env = new Dotenv(__DIR__);
$env->load();
// config time zone
date_default_timezone_set($_ENV['timeZone']);
// debug
if ($_ENV['debug'] == "true" ){
define("DEBUG",true);
}
$_ENV['version'] = '3.0.2';
// db config
$dbConfig = [
'driver' => Config::get('db_driver'),
'host' => Config::get('db_host'),
'database' => Config::get('db_database'),
'username' => Config::get('db_username'),
'password' => Config::get('db_password'),
'charset' => Config::get('db_charset'),
'collation' => Config::get('db_collation'),
'prefix' => Config::get('db_prefix')
];
// Init Eloquent ORM Connection
$capsule = new Capsule;
$capsule->addConnection($dbConfig);
$capsule->bootEloquent();