-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappstart.php
More file actions
22 lines (18 loc) · 870 Bytes
/
appstart.php
File metadata and controls
22 lines (18 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
// This is a custom autoloader for this template
use App\Config\DotEnvConfig;
use App\Config\WhoopsConfig;
require_once __DIR__ . "/vendor/autoload.php";
$dotenv = new DotEnvConfig();
if ($_ENV["DEBUG_MODE"] ?? true) {
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
new WhoopsConfig($dotenv->getVars());
}
$dotenv->initConfigs();
// Start DB Vars
$_ENV["DB_HOST"] = $_ENV["DEBUG_MODE"] ? $_ENV["DEBUG_DB_HOST"] : $_ENV["PRODUCTION_DB_HOST"];
$_ENV["DB_NAME"] = $_ENV["DEBUG_MODE"] ? $_ENV["DEBUG_DB_NAME"] : $_ENV["PRODUCTION_DB_NAME"];
$_ENV["DB_USER"] = $_ENV["DEBUG_MODE"] ? $_ENV["DEBUG_DB_USER"] : $_ENV["PRODUCTION_DB_USER"];
$_ENV["DB_PASS"] = $_ENV["DEBUG_MODE"] ? $_ENV["DEBUG_DB_PASS"] : $_ENV["PRODUCTION_DB_PASS"];
$_ENV["DB_PORT"] = $_ENV["DEBUG_MODE"] ? $_ENV["DEBUG_DB_PORT"] : $_ENV["PRODUCTION_DB_PORT"];