fix: replace env() with getenv() in import.php

This commit is contained in:
Tazyeuu
2026-06-10 23:19:15 +07:00
parent 330a0534d9
commit 346d67a15b
+5 -5
View File
@@ -1,11 +1,11 @@
<?php <?php
require_once __DIR__ . '/config/app.php'; require_once __DIR__ . '/config/app.php';
$host = env('DB_HOST', 'localhost'); $host = getenv('DB_HOST') ?: 'localhost';
$port = env('DB_PORT', 3306); $port = getenv('DB_PORT') ?: 3306;
$user = env('DB_USERNAME', 'root'); $user = getenv('DB_USERNAME') ?: 'root';
$pass = env('DB_PASSWORD', ''); $pass = getenv('DB_PASSWORD') ?: '';
$db = env('DB_DATABASE', 'webgis_db'); $db = getenv('DB_DATABASE') ?: 'webgis_db';
try { try {
$pdo = new PDO("mysql:host=$host;port=$port;dbname=$db;charset=utf8mb4", $user, $pass); $pdo = new PDO("mysql:host=$host;port=$port;dbname=$db;charset=utf8mb4", $user, $pass);