Skip to content

Commit b6000bf

Browse files
committed
fix: remove deprecation message on curl_close
Signed-off-by: Alexandre Rulleau <[email protected]>
1 parent 9c92228 commit b6000bf

File tree

49 files changed

+111
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+111
-111
lines changed

datadog-setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ function download($url, $destination, $retry = false)
15061506
}
15071507
}
15081508

1509-
curl_close($ch);
1509+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }
15101510
fclose($fp);
15111511

15121512
if (false !== $return) {

dockerfiles/testing-environment/Wordpress5/app/wp-includes/Requests/Transport/cURL.php

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dockerfiles/testing-environment/Wordpress5/app/wp-includes/SimplePie/File.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dockerfiles/testing-environment/Wordpress5/app/wp-includes/class-wp-http-curl.php

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/long-running/long-running-script.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function repetitive_function()
2424
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
2525
$output = curl_exec($ch);
2626
error_log('Received response: ' . var_export($output, 1));
27-
curl_close($ch);
27+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }
2828
}
2929

3030
$count = 0;

tests/C2PHP/get_context_distributed_tracing_test.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (empty($response['headers']['X-Datadog-Origin']) || $response['headers']['X-D
2828
throw new Exception('Unexpected origin header. ' . var_export($response, true));
2929
}
3030

31-
curl_close($ch);
31+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }
3232

3333
var_dump($context->origin);
3434
echo "OK\n";

tests/Common/TracerTestTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function sendTracesToTestAgent($traces)
111111
$response = self::curlWithoutSpan($curl);
112112

113113
// Close the cURL session
114-
curl_close($curl);
114+
if (PHP_VERSION_ID < 80000) { curl_close($curl); }
115115

116116
// Output the response for debugging purposes
117117
//echo $response;
@@ -201,7 +201,7 @@ public function inWebServer($fn, $rootPath, $envs = [], $inis = [], &$curlInfo =
201201
if (\is_array($curlInfo)) {
202202
$curlInfo = \array_merge($curlInfo, \curl_getinfo($curl));
203203
}
204-
\curl_close($curl);
204+
\if (PHP_VERSION_ID < 80000) { curl_close($curl); }
205205
$webServer->stop();
206206
return $response;
207207
}

tests/Common/WebFrameworkTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ protected function sendRequest($method, $url, $headers = [], $body = [], $change
262262
}
263263
$response = curl_exec($ch);
264264
if ($response === false && $i < 9) {
265-
\curl_close($ch);
265+
\if (PHP_VERSION_ID < 80000) { curl_close($ch); }
266266
// sleep for 100 milliseconds before trying again
267267
\usleep(100 * 1000);
268268
} else {
@@ -281,12 +281,12 @@ protected function sendRequest($method, $url, $headers = [], $body = [], $change
281281
curl_error($ch),
282282
curl_errno($ch)
283283
);
284-
curl_close($ch);
284+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }
285285
$this->fail($message);
286286
return null;
287287
}
288288

289-
curl_close($ch);
289+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }
290290

291291
return $response;
292292
}

tests/DistributedTracing/GH1070OriginHeaderSegfault/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
curl_setopt($ch, CURLOPT_URL, $url);
88
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
99
$output = curl_exec($ch);
10-
curl_close($ch);
10+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }

tests/Frameworks/Custom/Version_Autoloaded/no-root-span

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function my_app()
1111
$ch = curl_init('http://httpbin-integration/status/200');
1212
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1313
curl_exec($ch);
14-
curl_close($ch);
14+
if (PHP_VERSION_ID < 80000) { curl_close($ch); }
1515

1616
$mysqli = \mysqli_connect('mysql-integration', 'test', 'test', 'test');
1717
if ($mysqli) {

0 commit comments

Comments
 (0)