Add error handling for missing vendor to prevent 500 Empty Body errors

This commit is contained in:
Hamza-Ayed
2026-08-01 05:44:25 +03:00
parent 84c725040f
commit d0ab3653dd
2 changed files with 12 additions and 1 deletions
+4
View File
@@ -9,6 +9,10 @@
$autoload = __DIR__ . '/../vendor/autoload.php';
if (file_exists($autoload)) {
require_once $autoload;
} else {
http_response_code(500);
echo json_encode(['status' => 'failure', 'message' => 'Vendor autoload missing. Please run composer install.']);
exit;
}
// 2. لا حاجة لتحميل .env يدوياً: Docker يحقن المتغيّرات عبر env_file