Skip to content

Commit

Permalink
ext/curl: Add HTTP/3 constants (#15350)
Browse files Browse the repository at this point in the history
This intends to supersede the two following PRs:
 - #12000 because it does not modify the stub file, but only update the
   arginfo file. It also proposes to merge to GA branches, and is
   currently marked as Requires RM Approval.
 - #12543 Essentially the same as this PR and from the same author, as
   this, but its about a year old and requires rebasing anyway.

This adds the `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY`
constants on relevant versions (7.66 and 7.88 respectively).

It is possible to use HTTP/3 without having these constants declared,
but having them declared in PHP makes things more approachable and
"official".
  • Loading branch information
Ayesh authored Aug 12, 2024
1 parent 6cb6cc6 commit 81b49cd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ PHP NEWS
. Passing E_USER_ERROR to trigger_error() is now deprecated. (Girgias)
. Fixed bug GH-15292 (Dynamic AVX detection is broken for MSVC). (nielsdos)

- Curl:
. Added constants CURL_HTTP_VERSION_3 (libcurl 7.66) and CURL_HTTP_VERSION_3ONLY
(libcurl 7.88) as options for CURLOPT_HTTP_VERSION (Ayesh Karunaratne)

- Date:
. Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE
are now deprecated. (Jorg Sowa)
Expand Down
6 changes: 6 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ PHP 8.4 UPGRADE NOTES
. curl_version() returns an additional feature_list value, which is an
associative array of all known Curl features, and whether they are
supported (true) or not (false).
. Added CURL_HTTP_VERSION_3 and CURL_HTTP_VERSION_3ONLY constants (available
since libcurl 7.66 and 7.88) as available options for CURLOPT_HTTP_VERSION.

- Date:
. Added static methods
Expand Down Expand Up @@ -881,6 +883,10 @@ PHP 8.4 UPGRADE NOTES
. PHP_OUTPUT_HANDLER_PROCESSED.
. PHP_SBINDIR.

- Curl:
. CURL_HTTP_VERSION_3.
. CURL_HTTP_VERSION_3ONLY.

- Intl:
. The IntlDateFormatter class exposes now the new PATTERN constant
reflecting udat api's UDAT_PATTERN.
Expand Down
13 changes: 13 additions & 0 deletions ext/curl/curl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -3102,6 +3102,11 @@
* @cvalue CURLINFO_RETRY_AFTER
*/
const CURLINFO_RETRY_AFTER = UNKNOWN;
/**
* @var int
* @cvalue CURL_HTTP_VERSION_3
*/
const CURL_HTTP_VERSION_3 = UNKNOWN;
#endif

#if LIBCURL_VERSION_NUM >= 0x074300 /* Available since 7.67.0 */
Expand Down Expand Up @@ -3547,6 +3552,14 @@
const CURLOPT_QUICK_EXIT = UNKNOWN;
#endif

#if LIBCURL_VERSION_NUM >= 0x075800 /* Available since 7.88.0 */
/**
* @var int
* @cvalue CURL_HTTP_VERSION_3ONLY
*/
const CURL_HTTP_VERSION_3ONLY = UNKNOWN;
#endif

/**
* @var int
* @cvalue CURLOPT_SAFE_UPLOAD
Expand Down
8 changes: 7 additions & 1 deletion ext/curl/curl_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81b49cd

Please sign in to comment.