Skip to content

Commit e6f6cfb

Browse files
committed
chore(deprecated): remove curl_close function
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
1 parent 3344bc2 commit e6f6cfb

4 files changed

Lines changed: 0 additions & 10 deletions

File tree

index.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,10 @@ private function fetchUpdateServerResponse(string $updateURL): array {
611611

612612
if ($response === false) {
613613
$curlError = curl_error($curl);
614-
curl_close($curl);
615614
throw new \Exception('Could not do request to updater server: ' . $curlError);
616615
}
617616

618617
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
619-
curl_close($curl);
620618

621619
if ($httpCode !== 200 && $httpCode !== 204) {
622620
$this->silentLog('[warn] update server returned HTTP ' . $httpCode);
@@ -789,7 +787,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool {
789787
fclose($fp);
790788
unlink($toLocation);
791789
$this->silentLog('[warn] fail to download archive from ' . $fromUrl . '. Error: ' . $httpCode . ' ' . curl_error($ch));
792-
curl_close($ch);
793790

794791
return false;
795792
}
@@ -798,7 +795,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool {
798795
$info = curl_getinfo($ch);
799796
$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');
800797

801-
curl_close($ch);
802798
fclose($fp);
803799

804800
$this->silentLog('[info] end of downloadUpdate()');

lib/Updater.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,10 @@ private function fetchUpdateServerResponse(string $updateURL): array {
599599

600600
if ($response === false) {
601601
$curlError = curl_error($curl);
602-
curl_close($curl);
603602
throw new \Exception('Could not do request to updater server: ' . $curlError);
604603
}
605604

606605
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
607-
curl_close($curl);
608606

609607
if ($httpCode !== 200 && $httpCode !== 204) {
610608
$this->silentLog('[warn] update server returned HTTP ' . $httpCode);
@@ -777,7 +775,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool {
777775
fclose($fp);
778776
unlink($toLocation);
779777
$this->silentLog('[warn] fail to download archive from ' . $fromUrl . '. Error: ' . $httpCode . ' ' . curl_error($ch));
780-
curl_close($ch);
781778

782779
return false;
783780
}
@@ -786,7 +783,6 @@ private function downloadArchive(string $fromUrl, string $toLocation): bool {
786783
$info = curl_getinfo($ch);
787784
$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');
788785

789-
curl_close($ch);
790786
fclose($fp);
791787

792788
$this->silentLog('[info] end of downloadUpdate()');

tests/features/bootstrap/FeatureContext.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public function theCurrentInstalledVersionIs($installed, $version) {
122122
throw new \Exception('Download failed for ' . $url . ' - HTTP code: ' . $httpCode);
123123
}
124124

125-
curl_close($ch);
126125
fclose($fp);
127126
}
128127

@@ -237,7 +236,6 @@ public function theArchiveForVersionIsAvailableLocally(string $version): void {
237236
throw new \Exception('Download failed for ' . $url . ' - HTTP code: ' . $httpCode);
238237
}
239238

240-
curl_close($ch);
241239
fclose($fp);
242240
}
243241
}

updater.phar

305 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)