Replace database config with fallback

This commit is contained in:
Ahyan Z 2026-06-25 17:04:24 +01:00 committed by GitHub
parent 9dbad9cd51
commit db9fd8b5df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,11 +11,11 @@ ini_set('display_errors', 0); // Keep disabled in production so errors don't cor
// 2. DATABASE CONFIGURATION (Aiven Cloud Connection Matrix)
// ====================================================================
// Fall back to standard local development values if variables aren't injected by Vercel
$db_host = getenv('DB_HOST') ?: 'nostolgagram-nostolgagram.i.aivencloud.com';
$db_port = getenv('DB_PORT') ?: '3306'; // Default MySQL port (Aiven will overwrite this with 23006 via Vercel)
$db_user = getenv('DB_USER') ?: 'avnadmin';
$db_host = getenv('DB_HOST') ?: '127.0.0.1';
$db_port = getenv('DB_PORT') ?: '3306';
$db_user = getenv('DB_USER') ?: 'root';
$db_pass = getenv('DB_PASS') ?: '';
$db_name = 'defaultdb'; // Aiven's default workspace name
$db_name = 'defaultdb';
try {
// Open a secure database link using the fast, modern PHP Data Objects (PDO) framework