Update: 2026-05-14 19:26:32
This commit is contained in:
@@ -5,9 +5,13 @@ require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
// Load environment variables from .env
|
||||
$dotenv = Dotenv::createImmutable(__DIR__ . '/..');
|
||||
$dotenv->load();
|
||||
// Load environment variables from .env (located in the project root)
|
||||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../..');
|
||||
try {
|
||||
$dotenv->load();
|
||||
} catch (Exception $e) {
|
||||
// If .env is missing, we continue and rely on system env or defaults
|
||||
}
|
||||
|
||||
$host = $_ENV['DB_HOST'] ?? 'localhost';
|
||||
$dbname = $_ENV['DB_NAME'] ?? 'jordan_bot_db';
|
||||
|
||||
Reference in New Issue
Block a user