-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/curl: libcurl CURLOPT_{FTP_RESPONSE_TIMEOUT,ENCODING}
replacements
#15126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Related: #5094. It proposed to deprecate some of the even older constants, but was unfortunately closed to time constraints. It proposed to deprecate |
feaca43
to
cd42461
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, waiting a bit other people reviews in case.
cd42461
to
ec4e3ec
Compare
Adds `CURLOPT_SERVER_RESPONSE_TIMEOUT`, available since Curl 7.20.0. `CURLOPT_SERVER_RESPONSE_TIMEOUT` holds the same value as and it meant to replace `CURLOPT_FTP_RESPONSE_TIMEOUT`. See: - https://curl.se/libcurl/c/CURLOPT_SERVER_RESPONSE_TIMEOUT.html - https://curl.se/libcurl/c/CURLOPT_FTP_RESPONSE_TIMEOUT.html
ec4e3ec
to
cc3b902
Compare
…_ENCODING` In Curl 7.21.6, the `CURLOPT_ENCODING` constant was renamed to `CURLOPT_ACCEPT_ENCODING`. `CURLOPT_ENCODING` is deprecated from Curl 7.21.6. It still provides `CURLOPT_ENCODING` from `CURLOPT_ACCEPT_ENCODING` for backward compatibility. However, now that PHP requires Curl 7.61, we can safely use the new `CURLOPT_ACCEPT_ENCODING` constant.
cc3b902
to
dc4eb68
Compare
Rebased. Hopefully we can have this for PHP 8.4 🤓 |
Looking at it, I think it should be fine. |
cc @NattyNarwhal, @SakiTakamachi is it ok to add to 8.4 ? these are just constants. |
The PR itself was opened before the feature freeze, so I have no objection. |
Thanks ! |
Yay, thank you so much for the reviewing and merging this. |
Commit: php/php-src#15126 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_SERVER_RESPONSE_TIMEOUT` option to replace `CURLOPT_FTP_RESPONSE_TIMEOUT`](https://php.watch/versions/8.4/CURLOPT_SERVER_RESPONSE_TIMEOUT)
Commit: php/php-src#15126 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_SERVER_RESPONSE_TIMEOUT` option to replace `CURLOPT_FTP_RESPONSE_TIMEOUT`](https://php.watch/versions/8.4/CURLOPT_SERVER_RESPONSE_TIMEOUT)
Commit: php/php-src#15126 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_SERVER_RESPONSE_TIMEOUT` option to replace `CURLOPT_FTP_RESPONSE_TIMEOUT`](https://php.watch/versions/8.4/CURLOPT_SERVER_RESPONSE_TIMEOUT)
Commit: php/php-src#15126 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_SERVER_RESPONSE_TIMEOUT` option to replace `CURLOPT_FTP_RESPONSE_TIMEOUT`](https://php.watch/versions/8.4/CURLOPT_SERVER_RESPONSE_TIMEOUT)
Commit: php/php-src#15126 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_SERVER_RESPONSE_TIMEOUT` option to replace `CURLOPT_FTP_RESPONSE_TIMEOUT`](https://php.watch/versions/8.4/CURLOPT_SERVER_RESPONSE_TIMEOUT)
In ext/curl, it declares
CURLOPT_FTP_RESPONSE_TIMEOUT
andCURLOPT_ENCODING
constants although the corresponding libcurl constants are renamed.CURLOPT_FTP_RESPONSE_TIMEOUT
: Renamed toCURLOPT_SERVER_RESPONSE_TIMEOUT
. We do not declare the replacementCURLOPT_SERVER_RESPONSE_TIMEOUT
constant in ext/curl.CURLOPT_ENCODING
: Renamed toCURLOPT_ACCEPT_ENCODING
, and we do declareCURLOPT_ACCEPT_ENCODING
in ext/curl.This replaces the uses of
CURLOPT_ENCODING
andCURLOPT_FTP_RESPONSE_TIMEOUT
constants in stub@cvalue
declarations, and uses the replacement. Libcurl declares the old constants for backward compatibility, but now that we require libcurl 7.61 or later, we can safely use the new constants.The
CURLOPT_FTP_RESPONSE_TIMEOUT
constant seems to be never used in any applications, butCURLOPT_ENCODING
is used fairly often. We could deprecate it to discourage the use of it, but I'd like to leave it for the future because there are more constants (such asCURLOPT_DNS_USE_GLOBAL_CACHE
) that we can deprecate.