From 94d93e2b587aba7e8b33bac1adbbcceaecbefaf7 Mon Sep 17 00:00:00 2001 From: mark burdett Date: Tue, 7 Nov 2023 11:58:30 -0800 Subject: [PATCH] Throw a RuntimeException if cURL PHP extension is not loaded --- src/HttpClient/HttpClient.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/HttpClient/HttpClient.php b/src/HttpClient/HttpClient.php index 96a3dd01a..5c98fe7bf 100644 --- a/src/HttpClient/HttpClient.php +++ b/src/HttpClient/HttpClient.php @@ -40,6 +40,10 @@ public function sendRequest(Request $request, Options $options): Response throw new \RuntimeException('The request data is empty.'); } + if (!\extension_loaded('curl')) { + throw new \RuntimeException('The cURL PHP extension must be enabled to use the HttpClient.'); + } + $curlHandle = curl_init(); $requestHeaders = Http::getRequestHeaders($dsn, $this->sdkIdentifier, $this->sdkVersion);