&1 | tail -c 1000"); $stats_json = @file_get_contents('/var/www/html/api/blade-actions-surfaced.json'); $d = @json_decode($stats_json, true); echo json_encode(['ok' => true, 'stats' => $d['stats'] ?? [], 'actions_count' => count($d['actions'] ?? []), 'log_tail' => $out]);