From 6dbf0d75394a008cc613437fb8876518e4326064 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 23 May 2026 18:01:07 +0300 Subject: [PATCH] Clean up debug outputs and keep createMutable fix --- backend/config.php | 5 ----- backend/includes/Database.php | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/config.php b/backend/config.php index 51c3ae4..c80a3cb 100644 --- a/backend/config.php +++ b/backend/config.php @@ -10,19 +10,14 @@ if (file_exists(__DIR__ . '/vendor/autoload.php')) { // Check inside current dir, parent dir, grandparent dir, or user root dir $envPaths = [__DIR__, dirname(__DIR__), dirname(dirname(__DIR__)), dirname(dirname(dirname(__DIR__)))]; - $loadedEnvPath = 'none'; foreach ($envPaths as $path) { if (file_exists($path . '/.env')) { - $loadedEnvPath = $path . '/.env'; // Use createMutable to override any existing stuck environment variables $dotenv = Dotenv\Dotenv::createMutable($path); $dotenv->safeLoad(); break; } } - define('ENV_LOADED_PATH', $loadedEnvPath); -} else { - define('ENV_LOADED_PATH', 'vendor/autoload.php missing'); } // Database diff --git a/backend/includes/Database.php b/backend/includes/Database.php index 269f378..1bcaa08 100644 --- a/backend/includes/Database.php +++ b/backend/includes/Database.php @@ -27,7 +27,7 @@ class Database } catch (PDOException $e) { error_log('Database connection failed: ' . $e->getMessage()); http_response_code(500); - echo json_encode(['success' => false, 'message' => 'database_error', 'details' => $e->getMessage(), 'db_host' => DB_HOST, 'db_user' => DB_USER, 'env_path' => defined('ENV_LOADED_PATH') ? ENV_LOADED_PATH : 'unknown']); + echo json_encode(['success' => false, 'message' => 'database_error']); exit; } }