From 84aed0ae651fd73c0bafeee2276d6f41ff2a6b98 Mon Sep 17 00:00:00 2001 From: David Maicher Date: Mon, 5 Jan 2026 15:37:54 +0100 Subject: [PATCH] do not call curl_close on PHP 8.0+ --- src/File/Loader.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/File/Loader.php b/src/File/Loader.php index af29b944..f90be595 100644 --- a/src/File/Loader.php +++ b/src/File/Loader.php @@ -236,11 +236,17 @@ protected function readRemoteFileWithCurl() $errorMessage = 'curl_exec() failed.'; } $errorCode = curl_errno($curl); - curl_close($curl); + if (PHP_VERSION_ID < 80000) { + curl_close($curl); + } + throw new RuntimeException($errorMessage, $errorCode); } $responseInfo = curl_getinfo($curl); - curl_close($curl); + if (PHP_VERSION_ID < 80000) { + curl_close($curl); + } + if ($responseInfo['http_code'] == 404) { throw new NotFoundException(sprintf('File %s does not exist.', $this->path)); }