SEC-08B · Section 8: Prayer Times Management
✓ Fully Implemented
Automatic Prayer Time Sync, JAKIM e-Solat Source & Troubleshooting (/admin/prayer-times)
Technical and operational guide to automatic prayer time synchronization, the /admin/prayer-times administration console, CLI prayer-sync command, and troubleshooting missing times or API failures.
1. Official Prayer Time Source (JAKIM e-Solat)
Kariahku.com retrieves prayer times exclusively from the official JAKIM e-Solat endpoint:
- Endpoint:
https://www.e-solat.gov.my/index.php?r=esolatApi/takwimsolat&period={today|month}&zone={CODE} - Security & Validation: Enforces TLS certificate verification (`CURLOPT_SSL_VERIFYPEER = true`), a 12-second timeout, and strict `HH:MM` timestamp validation for all 7 prayer times before writing to `prayer_times`.
2. Automatic Updates & Admin Sync Controls (/admin/prayer-times)
- Automatic On-Demand Sync: Whenever a visitor opens `/prayer-times` or a mosque microsite and today’s schedule for that zone is not yet cached in `prayer_times`, `prayer_day_schedule()` automatically fetches today’s and the current month’s schedule from JAKIM e-Solat.
- Platform Admin Console (
/admin/prayer-times):- Open
/{lang}/admin/prayer-times. - Click Sync All Active Zones to refresh all 60 verified JAKIM zones, or select an individual zone and click Sync Zone.
- Open
- Scheduled CLI Command (Cron / Task Scheduler):
php database/manage.php prayer-sync
3. Troubleshooting Missing Prayer Times & API Failures
- Case 1 — Mosque Has No Zone Assigned: The microsite displays a configuration notice. Remedy: Assign an official zone in
/mosque-admin/prayer. - Case 2 — Temporary JAKIM e-Solat Outage: If live synchronization fails, `prayer_day_schedule()` falls back to the most recent cached schedule for that zone in `prayer_times` and displays an explicit Stale Schedule Warning indicating the cached date.
- Case 3 — Inspecting Sync Failures: Open
/admin/prayer-timesand review the Recent Synchronization Logs table (`prayer_sync_logs`) to check the `http_code` and `error_message`.
Input Fields & Options Reference
prayer_sync_logs Column | Description |
|---|---|
period_type | Sync scope: today, month, or catalogue. |
status | success or failed. |
records_written | Number of daily rows inserted/updated in prayer_times. |
http_code & error_message | HTTP status code returned by e-Solat and diagnostic error message. |
Expected Results: Prayer schedules across all 60 official JAKIM zones remain synchronized and resilient against temporary upstream outages.
Important Notes & Data Boundaries: The 60 official JAKIM prayer zones are seeded via `database/seeds/006_prayer_zones.php`.
Common Errors & Troubleshooting
If CLI or web sync fails with a cURL SSL certificate error on Windows/XAMPP, verify that curl.cainfo in php.ini points to a valid cacert.pem bundle and that outbound HTTPS to www.e-solat.gov.my is permitted.