fix: replace env() with getenv() in import.php
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user