ext/curl: Add feature_info
assoc array to curl_version()
#13439
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
phpinfo()
section of the Curl extension lists individual features supported by the particular ext-Curl + libcurl build. However, thecurl_version()
function return values do not indicate the same level of details.curl_version()
has aprotocols
key that returns an array of all protocols supported by the build. But thefeatures
key is a bitmask of all the features. Checking the availability of certain feature requires knowing the correspondingCURL_VERSION
constant, and checking the availability of the constant and a bitmask check for it in thefeatures
value.For example, to determine HTTP2 support, it requires evaluating:
To make feature availability checks more intuitive, this adds a new
feature_list
key tocurl_version()
output array.With it, checking for individual features availability is easier, and does not require inspecting the availability of the
CURL_VERSION
constant and thefeatures
key.