From 761b957c968ea7ce55b7fc892f1e982c277258ae Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 25 Jul 2026 15:55:18 +0300 Subject: [PATCH] Silence REQUEST_METHOD warning when bootstrap runs from the CLI The migration and backfill scripts load bootstrap.php outside a request, where $_SERVER['REQUEST_METHOD'] does not exist, so every CLI run printed a warning before its output. Co-Authored-By: Claude Opus 5 --- backend/core/bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/core/bootstrap.php b/backend/core/bootstrap.php index 7b6c9c7b..556cc092 100644 --- a/backend/core/bootstrap.php +++ b/backend/core/bootstrap.php @@ -51,7 +51,8 @@ if (in_array($origin, $allowedOrigins)) { header('Access-Control-Allow-Methods: POST, GET, OPTIONS'); header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Device-FP, X-HMAC-Auth, X-Internal-Key'); -if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { +// REQUEST_METHOD غير معرّف عند التشغيل من سطر الأوامر (سكربتات الترحيل) +if (($_SERVER['REQUEST_METHOD'] ?? '') === 'OPTIONS') { http_response_code(200); exit; }