diff --git a/.github/workflows/test-master.yml b/.github/workflows/test-master.yml index 4e1a3894..08c78133 100644 --- a/.github/workflows/test-master.yml +++ b/.github/workflows/test-master.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: ["8.2", "8.3"] + php-versions: ["8.3", "8.5"] name: test-master diff --git a/index.php b/index.php index ee07e2e5..5d7775e5 100644 --- a/index.php +++ b/index.php @@ -611,12 +611,10 @@ private function fetchUpdateServerResponse(string $updateURL): array { if ($response === false) { $curlError = curl_error($curl); - curl_close($curl); throw new \Exception('Could not do request to updater server: ' . $curlError); } $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - curl_close($curl); if ($httpCode !== 200 && $httpCode !== 204) { $this->silentLog('[warn] update server returned HTTP ' . $httpCode); @@ -789,7 +787,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool { fclose($fp); unlink($toLocation); $this->silentLog('[warn] fail to download archive from ' . $fromUrl . '. Error: ' . $httpCode . ' ' . curl_error($ch)); - curl_close($ch); return false; } @@ -798,7 +795,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool { $info = curl_getinfo($ch); $this->silentLog('[info] download stats: size=' . $this->formatBytes((int)$info['size_download']) . ' bytes; total_time=' . round($info['total_time'], 2) . ' secs; avg speed=' . $this->formatBytes((int)$info['speed_download']) . '/sec'); - curl_close($ch); fclose($fp); $this->silentLog('[info] end of downloadUpdate()'); diff --git a/lib/Updater.php b/lib/Updater.php index 848f4eb5..335d1c24 100644 --- a/lib/Updater.php +++ b/lib/Updater.php @@ -599,12 +599,10 @@ private function fetchUpdateServerResponse(string $updateURL): array { if ($response === false) { $curlError = curl_error($curl); - curl_close($curl); throw new \Exception('Could not do request to updater server: ' . $curlError); } $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - curl_close($curl); if ($httpCode !== 200 && $httpCode !== 204) { $this->silentLog('[warn] update server returned HTTP ' . $httpCode); @@ -777,7 +775,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool { fclose($fp); unlink($toLocation); $this->silentLog('[warn] fail to download archive from ' . $fromUrl . '. Error: ' . $httpCode . ' ' . curl_error($ch)); - curl_close($ch); return false; } @@ -786,7 +783,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool { $info = curl_getinfo($ch); $this->silentLog('[info] download stats: size=' . $this->formatBytes((int)$info['size_download']) . ' bytes; total_time=' . round($info['total_time'], 2) . ' secs; avg speed=' . $this->formatBytes((int)$info['speed_download']) . '/sec'); - curl_close($ch); fclose($fp); $this->silentLog('[info] end of downloadUpdate()'); diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php index 30d529f7..79f4d1dd 100644 --- a/tests/features/bootstrap/FeatureContext.php +++ b/tests/features/bootstrap/FeatureContext.php @@ -122,7 +122,6 @@ public function theCurrentInstalledVersionIs($installed, $version) { throw new \Exception('Download failed for ' . $url . ' - HTTP code: ' . $httpCode); } - curl_close($ch); fclose($fp); } @@ -237,7 +236,6 @@ public function theArchiveForVersionIsAvailableLocally(string $version): void { throw new \Exception('Download failed for ' . $url . ' - HTTP code: ' . $httpCode); } - curl_close($ch); fclose($fp); } } diff --git a/updater.phar b/updater.phar index 97123c61..26f86922 100755 Binary files a/updater.phar and b/updater.phar differ