new configs for deployment

This commit is contained in:
Araya's Project
2026-06-11 00:12:43 +07:00
parent bc415cd947
commit 5b316b2ef6
7 changed files with 25 additions and 101 deletions
+2 -8
View File
@@ -1,17 +1,11 @@
<?php
/**
* Koneksi database (PDO).
* Mendukung environment variable Docker (DB_HOST) maupun hardcoded untuk Laragon.
*/
define('DB_HOST', getenv('DB_HOST') ?: '127.0.0.1');
define('DB_PORT', '3306');
define('DB_NAME', 'sig_mapping');
define('DB_USER', getenv('DB_USER') ?: 'root');
define('DB_PASS', getenv('DB_PASS') ?: '');
function db(): PDO
{
function db(): PDO {
static $pdo = null;
if ($pdo === null) {
$dsn = sprintf('mysql:host=%s;port=%s;dbname=%s;charset=utf8mb4', DB_HOST, DB_PORT, DB_NAME);
@@ -22,4 +16,4 @@ function db(): PDO
]);
}
return $pdo;
}
}