'not found']) . PHP_EOL; return; } $attempt = is_file($counterFile) ? (int) file_get_contents($counterFile) : 0; $attempt++; file_put_contents($counterFile, (string) $attempt); if ($attempt < 3) { http_response_code(503); echo json_encode([ 'status' => 'busy', 'attempt' => $attempt, ], JSON_UNESCAPED_SLASHES) . PHP_EOL; return; } echo json_encode([ 'status' => 'ok', 'attempt' => $attempt, ], JSON_UNESCAPED_SLASHES) . PHP_EOL;