diff --git a/backend/transit/functions.php b/backend/transit/functions.php index 3b9169e7..3c3f6a28 100644 --- a/backend/transit/functions.php +++ b/backend/transit/functions.php @@ -7,13 +7,18 @@ // • jsonSuccess() / jsonError() ← core/helpers.php // • appLog() / securityLog() ← core/helpers.php // • normalizePhone($phone) ← core/helpers.php — يطبّع الهاتف دائماً قبل التشفير أو الاستعلام -// • OtpService($redis) ← core/Services/OtpService.php // • $encryptionHelper ← مهيَّأ في bootstrap.php // • $redis ← مهيَّأ في bootstrap.php -// • sendWhatsAppFromServer() ← backend/functions.php -// • FcmService($redis) ← core/Services/FcmService.php // ============================================================ +// Lazy-loaded services (bootstrap لا يحمّلها لأنها ليست مطلوبة لكل endpoint) +require_once __DIR__ . '/../core/Services/OtpService.php'; +require_once __DIR__ . '/../core/Services/FcmService.php'; +// sendWhatsAppFromServer — الموجودة في backend/functions.php القديمة +if (file_exists(__DIR__ . '/../functions.php')) { + require_once __DIR__ . '/../functions.php'; +} + // ── حقول مطلوبة (غلاف رفيع يستخدم filterRequest + jsonError) ── function requireTransitFields(array $fields): void {