#!/usr/bin/env php X2Score Data Sync CLI Ensures data integrity between local database and API-Football. Usage: php sync-data.php [options] Options: --check Check fixtures integrity (dry run by default) --fix Fix detected mismatches (use with --check or --live) --live Check only live fixtures --full-sync Full re-sync (re-fetch all data) --standings Sync all league standings --status Show current sync status --date=YYYY-MM-DD Specify date (default: today) --range=N Check last N days --help Show this help Examples: php sync-data.php --status Show current data status php sync-data.php --check Check today's fixtures (dry run, no changes) php sync-data.php --check --fix Check and fix today's fixtures php sync-data.php --check --range=7 --fix Check and fix last 7 days php sync-data.php --live --fix Check and fix live fixtures (real-time sync) php sync-data.php --full-sync --date=2026-01-15 Full re-sync for specific date php sync-data.php --standings Sync standings for all selected leagues Sync Strategies: 1. --check (dry run) Compare DB vs API, report mismatches 2. --check --fix Compare and automatically fix mismatches 3. --live --fix Real-time sync for live matches 4. --full-sync Complete re-fetch (use sparingly, high API usage) 5. --standings Update all league standings Recommended Usage: - Run --live --fix frequently (every 5 min) for live match accuracy - Run --check --fix daily for data integrity - Run --standings daily for up-to-date standings - Run --full-sync only when data is badly corrupted