From 581bf73e5752802998769d1a199fe97af853b3be Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 00:21:53 +0700 Subject: [PATCH 1/9] [PHP 8.4] Curl: Add `curl_version` - `features_list` entry Commit: php/php-src#13439 PHP.Watch: [PHP 8.4: Curl: `curl_version()` `feature_list` support](https://php.watch/versions/8.4/curl_version-feature_list) --- reference/curl/functions/curl-version.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/curl/functions/curl-version.xml b/reference/curl/functions/curl-version.xml index 9f21d61fbd62..765c464873a6 100644 --- a/reference/curl/functions/curl-version.xml +++ b/reference/curl/functions/curl-version.xml @@ -71,6 +71,13 @@ protocols An array of protocols names supported by cURL + + feature_list + + An associative array of all known cURL features, and whether they + are supported (&true;) or not (&false;) + + @@ -88,6 +95,12 @@ + + 8.4.0 + + features_list added. + + 8.0.0 From 32a4c84718375f9b8647740eee07d1dbd980026a Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 00:26:06 +0700 Subject: [PATCH 2/9] [PHP 8.4] Curl: PHP 8.4 requires libcurl >= 7.61 Commit: php/php-src#13259 PHP.Watch: [PHP 8.4: Curl: Minimum required libcurl version increased to 7.61.0](https://php.watch/versions/8.4/curl-libcurl-version-bump) --- reference/curl/setup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/curl/setup.xml b/reference/curl/setup.xml index 229bbb0db1c3..75f471b16378 100644 --- a/reference/curl/setup.xml +++ b/reference/curl/setup.xml @@ -13,6 +13,7 @@ version 7.10.5 or later. As of PHP 7.3.0, version 7.15.5 or later is required. As of PHP 8.0.0, version 7.29.0 or later is required. + As of PHP 8.4.0, version 7.61.0 or later is required. From a8e3078885f2cd96a7f6774fc5178140ec267ceb Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 01:14:22 +0700 Subject: [PATCH 3/9] [PHP 8.4] Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no-op Commit: php/php-src#15127 PHP.Watch: [PHP 8.4: Curl: `CURLOPT_DNS_USE_GLOBAL_CACHE` no longer has any effect](https://php.watch/versions/8.4/CURLOPT_DNS_USE_GLOBAL_CACHE-no-op) --- reference/curl/constants_curl_setopt.xml | 1 + reference/curl/functions/curl-setopt.xml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/reference/curl/constants_curl_setopt.xml b/reference/curl/constants_curl_setopt.xml index 371646307a0c..58289a3cb9d5 100644 --- a/reference/curl/constants_curl_setopt.xml +++ b/reference/curl/constants_curl_setopt.xml @@ -597,6 +597,7 @@ It is conditionally enabled by default if PHP is built for non-threaded use (CLI, FCGI, Apache2-Prefork, etc.). Available as of cURL 7.9.3 and deprecated as of cURL 7.11.1. + As of PHP 8.4, this option no longer has any effect. diff --git a/reference/curl/functions/curl-setopt.xml b/reference/curl/functions/curl-setopt.xml index 7eb8c3d73f9b..bea2c818411b 100644 --- a/reference/curl/functions/curl-setopt.xml +++ b/reference/curl/functions/curl-setopt.xml @@ -66,6 +66,13 @@ + + 8.4.0 + + CURLOPT_DNS_USE_GLOBAL_CACHE no longer has any effect, + and enabling it on thread-safe PHP builds no longer triggers a warning. + + &curl.changelog.handle-param; 7.3.15, 7.4.3 From bfcfac644736f5188823ef5e22d6e57d8a4528d2 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 01:43:17 +0700 Subject: [PATCH 4/9] [PHP 8.4] Curl: Add `CURL_HTTP_VERSION_3(ONLY)` constants Commit: php/php-src#15350 PHP.Watch: [PHP 8.4: Curl: New `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY` constants for HTTP/3 support](https://php.watch/versions/8.4/CURL_HTTP_VERSION_3-CURL_HTTP_VERSION_3ONLY) --- reference/curl/constants.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/reference/curl/constants.xml b/reference/curl/constants.xml index 0c782b933476..0dc90276fca2 100644 --- a/reference/curl/constants.xml +++ b/reference/curl/constants.xml @@ -1374,6 +1374,28 @@ + + + CURL_HTTP_VERSION_3 + (int) + + + + Available as of PHP 8.4.0 and cURL 7.66.0. + + + + + + CURL_HTTP_VERSION_3ONLY + (int) + + + + Available as of PHP 8.4.0 and cURL 7.88.0. + + + CURL_HTTP_VERSION_NONE From e300f05cd9d97007fbeeeacdcb9f86ad801338cf Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 02:42:05 +0700 Subject: [PATCH 5/9] [PHP 8.4] Curl: `curl_getinfo` - add `CURLINFO_POSTTRANSFER_TIME_T` Commit: php/php-src#15849 PHP.Watch: [PHP 8.4: Curl: `curl_getinfo` - `CURLINFO_POSTTRANSFER_TIME_T` support](https://php.watch/versions/8.4/CURLINFO_POSTTRANSFER_TIME_T) --- reference/curl/constants_curl_getinfo.xml | 12 ++++++++++++ reference/curl/functions/curl-getinfo.xml | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/reference/curl/constants_curl_getinfo.xml b/reference/curl/constants_curl_getinfo.xml index 43414c6d8501..115537120642 100644 --- a/reference/curl/constants_curl_getinfo.xml +++ b/reference/curl/constants_curl_getinfo.xml @@ -776,4 +776,16 @@ + + + CURLINFO_POSTTRANSFER_TIME_T + (int) + + + + Time it took from the start until the last byte is sent, in microseconds. + Available as of PHP 8.4.0 and cURL 8.10.0 + + + diff --git a/reference/curl/functions/curl-getinfo.xml b/reference/curl/functions/curl-getinfo.xml index 882c7ba816d8..0d4e8269fe46 100644 --- a/reference/curl/functions/curl-getinfo.xml +++ b/reference/curl/functions/curl-getinfo.xml @@ -178,6 +178,11 @@ is set by a previous call to curl_setopt) + + + "posttransfer_time_us" (Available as of PHP 8.4.0 and cURL 8.10.0) + + Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE option. @@ -195,6 +200,12 @@ + + 8.4.0 + + Introduced CURLINFO_POSTTRANSFER_TIME_T constant and posttransfer_time_us (Curl 8.10.0 or later). + + 8.3.0 From e0a6e5f8b061606e4b34055fafaf9f295461726b Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 12:33:35 +0700 Subject: [PATCH 6/9] [PHP 8.4] Curl: Add `CURLOPT_PREREQFUNCTION` optiona and constants Commit: php/php-src#13255 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_PREREQFUNCTION` option](https://php.watch/versions/8.4/CURLOPT_PREREQFUNCTION) --- reference/curl/constants.xml | 22 +++++++ reference/curl/constants_curl_setopt.xml | 74 ++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/reference/curl/constants.xml b/reference/curl/constants.xml index 0dc90276fca2..96570a08ad74 100644 --- a/reference/curl/constants.xml +++ b/reference/curl/constants.xml @@ -2284,6 +2284,28 @@ + + + CURL_PREREQFUNC_OK + (int) + + + + Available as of PHP 8.4.0 and cURL 7.80.0. + + + + + + CURL_PREREQFUNC_ABORT + (int) + + + + Available as of PHP 8.4.0 and cURL 7.80.0. + + + &reference.curl.constants-curl-setopt; &reference.curl.constants-curl-share-setopt; diff --git a/reference/curl/constants_curl_setopt.xml b/reference/curl/constants_curl_setopt.xml index 58289a3cb9d5..40bd776404a4 100644 --- a/reference/curl/constants_curl_setopt.xml +++ b/reference/curl/constants_curl_setopt.xml @@ -4442,4 +4442,78 @@ + + + CURLOPT_PREREQFUNCTION + (int) + + + + A callable with the following signature that gets called after the + connection is established, but before the request payload (for example, the + GET/POST/DELETE request of an HTTP connection) is sent, and can be used to abort + or allow the connection depending on the source and destination IP address and + port numbers: + + intcallback + CurlHandlecurlHandle + stringdestination_ip + stringlocal_ip + intdestination_port + intlocal_port + + + + curlHandle + + + The cURL handle. + + + + + destination_ip + + + The primary IP of the remote server established with this connection. + For FTP, this is the IP for the control connection. + IPv6 addresses are represented without surrounding brackets. + + + + + local_ip + + + The originating IP for this connection. + IPv6 addresses are represented without surrounding brackets. + + + + + destination_port + + + The primary port number on the remote server established with this connection. + For FTP, this is the port for the control connection. + This can be a TCP or a UDP port number depending on the protocol. + + + + + local_port + + + The originating port number for this connection. + This can be a TCP or a UDP port number depending on the protocol. + + + + + Return CURL_PREREQFUNC_OK to allow the request, or + CURL_PREREQFUNC_ABORT to abort the transfer. + Available as of PHP 8.4.0 and cURL 7.80.0. + + + From 0ed77f9bd8eaa2a7c7a709bd321ded5ee7c68096 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 20:51:57 +0700 Subject: [PATCH 7/9] [PHP 8.4] Curl: Add `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) --- reference/curl/constants_curl_setopt.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/reference/curl/constants_curl_setopt.xml b/reference/curl/constants_curl_setopt.xml index 40bd776404a4..37c751a590ed 100644 --- a/reference/curl/constants_curl_setopt.xml +++ b/reference/curl/constants_curl_setopt.xml @@ -971,6 +971,8 @@ A timeout in seconds cURL will wait for a response from an FTP server. This option overrides CURLOPT_TIMEOUT. This option accepts any value that can be cast to a valid int. + This option name is replaced with CURLOPT_SERVER_RESPONSE_TIMEOUT, + available as of PHP 8.4.0. Available as of cURL 7.10.8 and deprecated as of cURL 7.85.0. @@ -4428,6 +4430,22 @@ + + + CURLOPT_SERVER_RESPONSE_TIMEOUT + (int) + + + + A timeout in seconds cURL will wait for a response from an + FTP, SFTP, IMAP, + SCP, SMTP, or a POP3 server. + This option replaces the existing CURLOPT_FTP_RESPONSE_TIMEOUT + option which is deprecated in cURL 7.85.0. + Available as of PHP 8.4.0. + + + CURLOPT_XOAUTH2_BEARER From 826c2e6d807570a97837fd79992c46e8a66108d7 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 22:55:08 +0700 Subject: [PATCH 8/9] [PHP 8.4] Curl: Add `CURLOPT_DEBUGFUNCTION` Commit: php/php-src#15674 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_DEBUGFUNCTION` option](https://php.watch/versions/8.4/CURLOPT_DEBUGFUNCTION) --- reference/curl/constants_curl_setopt.xml | 127 +++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/reference/curl/constants_curl_setopt.xml b/reference/curl/constants_curl_setopt.xml index 37c751a590ed..263eb19d270c 100644 --- a/reference/curl/constants_curl_setopt.xml +++ b/reference/curl/constants_curl_setopt.xml @@ -4534,4 +4534,131 @@ + + + CURLOPT_DEBUGFUNCTION + (int) + + + + Available as of PHP 8.4.0. + This option requires CURLOPT_VERBOSE option enabled. + A callable to replace the standard cURL verbose output. + This callback gets called during various stages of the request with verbose debug information. + The callback should match the following signature: + + voidcallback + CurlHandlecurlHandle + inttype + stringdata + + + + curlHandle + + + The cURL handle. + + + + + type + + + One of the following constants indicating the type of the data value: + + + + + CURLINFO_TEXT + (int) + + + + Informational text. + + + + + + CURLINFO_HEADER_IN + (int) + + + + Header (or header-like) data received from the peer. + + + + + + CURLINFO_HEADER_OUT + (int) + + + + Header (or header-like) data sent to the peer. + + + + + + CURLINFO_DATA_IN + (int) + + + + Unprocessed protocol data received from the peer. + Even if the data is encoded or compressed, it is not provided decoded nor decompressed to this callback. + + + + + + CURLINFO_DATA_OUT + (int) + + + + Protocol data sent to the peer. + + + + + + CURLINFO_SSL_DATA_IN + (int) + + + + SSL/TLS (binary) data received from the peer. + + + + + + CURLINFO_SSL_DATA_OUT + (int) + + + + SSL/TLS (binary) data sent to the peer. + + + + + + + + data + + + Verbose debug data of the type indicate by the type parameter. + + + + + + + From 58e0647b0ab5dae494df89d0df1dc24092ad6cbf Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Thu, 14 Nov 2024 23:54:05 +0700 Subject: [PATCH 9/9] [PHP 8.4] Curl: Add `CURLOPT_TCP_KEEPCNT` option Commit: php/php-src#15446 PHP.Watch: [PHP 8.4: Curl: New `CURLOPT_TCP_KEEPCNT` option](https://php.watch/versions/8.4/CURLOPT_TCP_KEEPCNT) --- reference/curl/constants_curl_setopt.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/reference/curl/constants_curl_setopt.xml b/reference/curl/constants_curl_setopt.xml index 263eb19d270c..a175e7e02025 100644 --- a/reference/curl/constants_curl_setopt.xml +++ b/reference/curl/constants_curl_setopt.xml @@ -3855,6 +3855,8 @@ frequency of these probes can be controlled by the CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL options, provided the operating system supports them. If set to 0 (default) keepalive probes are disabled. + The maximum number of probes can be set with the CURLOPT_TCP_KEEPCNT + option. Available as of cURL 7.25.0. @@ -3889,6 +3891,19 @@ + + + CURLOPT_TCP_KEEPCNT + (int) + + + + Sets the maximum number of TCP keep-alive probes. + The default is 9. + Available as of PHP 8.4.0 and cURL 8.9.0. + + + CURLOPT_TCP_NODELAY