[php-src] PR #17848: Fix, update and prettify cURL information: `phpinfo()` and `curl_version()`
| From: | nono303 | Date: | Tue, 18 Feb 2025 11:00:35 +0000 |
| Subject: | [php-src] PR #17848: Fix, update and prettify cURL information: `phpinfo()` and `curl_version()` | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30834@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17848
Author: nono303
- Remove empty, null & deprecated values
- Ensure displaying human readable values
- Fix typo (like **ares** version was displayed as **ZLib**)
- Fix non-working condition with
CURLVERSION_NOW using age
- Use feature_names if available instead of const feats[] and display
features as list (like for protocols)
- Update (legacy) duplicated const feats[] with CURL_VERSION_CURLDEBUG,
CURL_VERSION_THREADSAFE
- Display SSL supported backends
- Add new supported protocols (**Brotli**, **Nghttp2**, **QUIC**, **Zstd**, **Hyper**, **GNU SASL**,
**RTMP**)
- Return protocols module versions in an array for curl_version()
> Result with same **cURL 8.12.1** and **PHP 8.4.4**:
### phpinfo()
#### before

#### after

### curl_version()
#### before
``````
[version_number] => 527361
[age] => 11
[features] => 1575833501
[feature_list] => Array
(
[AsynchDNS] => 1
[CharConv] =>
[Debug] =>
[GSS-Negotiate] =>
[IDN] => 1
[IPv6] => 1
[krb4] =>
[Largefile] => 1
[libz] => 1
[NTLM] => 1
[NTLMWB] =>
[SPNEGO] => 1
[SSL] => 1
[SSPI] => 1
[TLS-SRP] => 1
[HTTP2] => 1
[GSSAPI] =>
[KERBEROS5] => 1
[UNIX_SOCKETS] => 1
[PSL] =>
[HTTPS_PROXY] => 1
[MULTI_SSL] => 1
[BROTLI] => 1
[ALTSVC] => 1
[HTTP3] =>
[UNICODE] => 1
[ZSTD] => 1
[HSTS] => 1
[GSASL] =>
)
[ssl_version_number] => 0
[version] => 8.12.1-DEV
[host] => Windows
[ssl_version] => (OpenSSL/3.4.1) Schannel
[libz_version] => 1.3.1
[protocols] => Array
(
[0] => dict
[1] => file
[2] => ftp
[3] => ftps
[4] => gopher
[5] => gophers
[6] => http
[7] => https
[8] => imap
[9] => imaps
[10] => ldap
[11] => ldaps
[12] => mqtt
[13] => pop3
[14] => pop3s
[15] => rtsp
[16] => scp
[17] => sftp
[18] => smb
[19] => smbs
[20] => smtp
[21] => smtps
[22] => telnet
[23] => tftp
[24] => ws
[25] => wss
)
[ares] => 1.34.4
[ares_num] => 74244
[libidn] =>
[iconv_ver_num] => 0
[libssh_version] => libssh2/1.11.1_DEV
[brotli_ver_num] => 16781312
[brotli_version] => brotli/1.1.0
``````
#### after
``````
[version] => 8.12.1-DEV
[age] => 11
[host] => Windows
[features] => Array
(
[0] => alt-svc
[1] => AsynchDNS
[2] => brotli
[3] => HSTS
[4] => HTTP2
[5] => HTTPS-proxy
[6] => HTTPSRR
[7] => IDN
[8] => IPv6
[9] => Kerberos
[10] => Largefile
[11] => libz
[12] => MultiSSL
[13] => NTLM
[14] => SPNEGO
[15] => SSL
[16] => SSLS-EXPORT
[17] => SSPI
[18] => threadsafe
[19] => TLS-SRP
[20] => Unicode
[21] => UnixSockets
[22] => zstd
)
[protocols] => Array
(
[0] => dict
[1] => file
[2] => ftp
[3] => ftps
[4] => gopher
[5] => gophers
[6] => http
[7] => https
[8] => imap
[9] => imaps
[10] => ldap
[11] => ldaps
[12] => mqtt
[13] => pop3
[14] => pop3s
[15] => rtsp
[16] => scp
[17] => sftp
[18] => smb
[19] => smbs
[20] => smtp
[21] => smtps
[22] => telnet
[23] => tftp
[24] => ws
[25] => wss
)
[ssl_backends] => Array
(
[0] => openssl
[1] => schannel
)
[feature_version] => Array
(
[ssl] => OpenSSL/3.4.1 (Schannel)
[libz] => 1.3.1
[ares] => 1.34.4
[libssh] => libssh2/1.11.1_DEV
[brotli] => brotli/1.1.0
[nghttp2] => 1.64.0
[zstd] => zstd/1.5.6
)
``````