diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index d0ba89f..214caa1 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -16,7 +16,7 @@ jobs: "5.6", "7.4", "8.0", - "8.4", + "8.5", ] os: [ubuntu-latest, macOS-latest, windows-latest] steps: diff --git a/lib/Tinify.php b/lib/Tinify.php index 9e34876..80f533f 100644 --- a/lib/Tinify.php +++ b/lib/Tinify.php @@ -2,7 +2,7 @@ namespace Tinify; -const VERSION = "1.6.3"; +const VERSION = "1.6.4"; class Tinify { private static $key = NULL; diff --git a/lib/Tinify/Client.php b/lib/Tinify/Client.php index 531b830..93bd513 100644 --- a/lib/Tinify/Client.php +++ b/lib/Tinify/Client.php @@ -112,7 +112,9 @@ function request($method, $url, $body = NULL) { if (is_string($response)) { $status = curl_getinfo($request, CURLINFO_HTTP_CODE); $headerSize = curl_getinfo($request, CURLINFO_HEADER_SIZE); - curl_close($request); + if (PHP_VERSION_ID < 80000) { + curl_close($request); + } $headers = self::parseHeaders(substr($response, 0, $headerSize)); $responseBody = substr($response, $headerSize); @@ -140,7 +142,9 @@ function request($method, $url, $body = NULL) { throw Exception::create($details->message, $details->error, $status); } else { $message = sprintf("%s (#%d)", curl_error($request), curl_errno($request)); - curl_close($request); + if (PHP_VERSION_ID < 80000) { + curl_close($request); + } if ($retries > 0) continue; throw new ConnectionException("Error while connecting: " . $message); } diff --git a/test/curl_mock.php b/test/curl_mock.php index 9008924..8fe6a00 100644 --- a/test/curl_mock.php +++ b/test/curl_mock.php @@ -17,6 +17,7 @@ class CurlMock { private static $version = array(); public $options = array(); + public $request; public $response; public $closed = false;