Skip to content

Commit

Permalink
[PHP 8.4] Fix: Curl CURLOPT_BINARYTRANSFER deprecated
Browse files Browse the repository at this point in the history
The `CURLOPT_BINARYTRANSFER` PHP constant from the Curl extension was no-op since
PHP 5.1, and is deprecated in PHP 8.4. This removes the constant usage to avoid
the deprecation notice in PHP 8.4 and later.

Because this constant was no-op since PHP 5.1 (circa 2005), this change has no
impact.

See:

 - [PHP.Watch - PHP 8.4 - Curl: CURLOPT_BINARYTRANSFER deprecated](https://php.watch/versions/8.4/CURLOPT_BINARYTRANSFER-deprecated)
 - [commit](php/php-src@fc16285)
  • Loading branch information
Ayesh committed Jan 16, 2024
1 parent 2ce9cc2 commit ff1ecd1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/Service/CurlService.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ private function initRequest(Request $request): CurlHandle {
curl_setopt($curl, CURLOPT_TIMEOUT, $request->getTimeout());

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_BINARYTRANSFER, $request->isBinary());

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $request->isVerifyPeer());
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, $request->isFollowLocation());
Expand Down
1 change: 0 additions & 1 deletion lib/Tools/Traits/TRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ private function initRequest(Request $request) {
curl_setopt($curl, CURLOPT_TIMEOUT, $request->getTimeout());

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_BINARYTRANSFER, $request->isBinary());

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $request->isVerifyPeer());
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, $request->isFollowLocation());
Expand Down

0 comments on commit ff1ecd1

Please sign in to comment.