Skip to content

Commit ad4f383

Browse files
committed
[cURL] Update cURL features list
1 parent 51eec50 commit ad4f383

File tree

4 files changed

+156
-0
lines changed

4 files changed

+156
-0
lines changed

ext/curl/interface.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ PHP_MINFO_FUNCTION(curl)
274274
{"SSL", CURL_VERSION_SSL},
275275
{"SSPI", CURL_VERSION_SSPI},
276276
{"TLS-SRP", CURL_VERSION_TLSAUTH_SRP},
277+
{"TrackMemory", CURL_VERSION_CURLDEBUG},
277278
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
278279
{"HTTP2", CURL_VERSION_HTTP2},
279280
#endif
@@ -295,6 +296,22 @@ PHP_MINFO_FUNCTION(curl)
295296
#endif
296297
#if LIBCURL_VERSION_NUM >= 0x073900 /* 7.57.0 */
297298
{"BROTLI", CURL_VERSION_BROTLI},
299+
#endif
300+
#if LIBCURL_VERSION_NUM >= 0x074001 /* 7.64.1 */
301+
{"Alt-Svc", CURL_VERSION_ALTSVC},
302+
#endif
303+
#if LIBCURL_VERSION_NUM >= 0x074200 /* 7.66.0 */
304+
{"HTTP3", CURL_VERSION_HTTP3},
305+
#endif
306+
#if LIBCURL_VERSION_NUM >= 0x074800 /* 7.72.0 */
307+
{"Unicode", CURL_VERSION_UNICODE},
308+
{"Zstandard", CURL_VERSION_ZSTD},
309+
#endif
310+
#if LIBCURL_VERSION_NUM >= 0x074a00 /* 7.74.0 */
311+
{"HSTS", CURL_VERSION_HSTS},
312+
#endif
313+
#if LIBCURL_VERSION_NUM >= 0x074c00 /* 7.76.0 */
314+
{"Libgsasl", CURL_VERSION_GSASL},
298315
#endif
299316
{NULL, 0}
300317
};
@@ -1155,6 +1172,10 @@ PHP_MINIT_FUNCTION(curl)
11551172
REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC);
11561173
#endif
11571174

1175+
#if LIBCURL_VERSION_NUM >= 0x074200 /* Available since 7.66.0 */
1176+
REGISTER_CURL_CONSTANT(CURL_VERSION_HTTP3);
1177+
#endif
1178+
11581179
#if LIBCURL_VERSION_NUM >= 0x074700 /* Available since 7.71.0 */
11591180
REGISTER_CURL_CONSTANT(CURLOPT_ISSUERCERT_BLOB);
11601181
REGISTER_CURL_CONSTANT(CURLOPT_PROXY_ISSUERCERT);
@@ -1165,6 +1186,19 @@ PHP_MINIT_FUNCTION(curl)
11651186
REGISTER_CURL_CONSTANT(CURLOPT_SSLKEY_BLOB);
11661187
#endif
11671188

1189+
#if LIBCURL_VERSION_NUM >= 0x074800 /* Available since 7.72.0 */
1190+
REGISTER_CURL_CONSTANT(CURL_VERSION_UNICODE);
1191+
REGISTER_CURL_CONSTANT(CURL_VERSION_ZSTD);
1192+
#endif
1193+
1194+
#if LIBCURL_VERSION_NUM >= 0x074a00 /* Available since 7.74.0 */
1195+
REGISTER_CURL_CONSTANT(CURL_VERSION_HSTS);
1196+
#endif
1197+
1198+
#if LIBCURL_VERSION_NUM >= 0x074c00 /* Available since 7.76.0 */
1199+
REGISTER_CURL_CONSTANT(CURL_VERSION_GSASL);
1200+
#endif
1201+
11681202
REGISTER_CURL_CONSTANT(CURLOPT_SAFE_UPLOAD);
11691203

11701204
#ifdef PHP_CURL_NEED_OPENSSL_TSL
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
--TEST--
2+
Check libcurl features list
3+
--SKIPIF--
4+
<?php
5+
6+
if (substr(PHP_OS, 0, 3) === 'WIN') {
7+
exit('skip: test doesn\'t work with Windows');
8+
}
9+
10+
$version = curl_version();
11+
12+
if ($version['version_number'] < 0x071d00) {
13+
exit('skip: test works only with curl >= 7.29.0');
14+
}
15+
16+
?>
17+
--FILE--
18+
<?php
19+
ob_start();
20+
phpinfo();
21+
$s = ob_get_contents();
22+
ob_end_clean();
23+
preg_match('/curl\n\n(.+)\n\n/siU', $s, $m);
24+
25+
echo $m[1], "\n";
26+
27+
?>
28+
--EXPECTF--
29+
cURL support => enabled
30+
cURL Information => %s
31+
Age => %d
32+
Features
33+
AsynchDNS => Yes
34+
CharConv => No
35+
Debug => No
36+
GSS-Negotiate => No
37+
IDN => Yes
38+
IPv6 => Yes
39+
krb4 => No
40+
Largefile => Yes
41+
libz => Yes
42+
NTLM => Yes
43+
NTLMWB => Yes
44+
SPNEGO => Yes
45+
SSL => Yes
46+
SSPI => No
47+
TLS-SRP => Yes
48+
TrackMemory => No
49+
HTTP2 => Yes
50+
GSSAPI => Yes
51+
KERBEROS5 => Yes
52+
UNIX_SOCKETS => Yes
53+
PSL => Yes
54+
HTTPS_PROXY => Yes
55+
MULTI_SSL => No
56+
BROTLI => No
57+
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
58+
Host => %s
59+
SSL Version => GnuTLS/%s
60+
ZLib Version => %s
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
--TEST--
2+
Check libcurl features list
3+
--SKIPIF--
4+
<?php
5+
6+
if (substr(PHP_OS, 0, 3) !== 'WIN') {
7+
exit('skip: test only works with Windows');
8+
}
9+
10+
$version = curl_version();
11+
12+
if ($version['version_number'] < 0x071d00) {
13+
exit('skip: test works only with curl >= 7.29.0');
14+
}
15+
16+
?>
17+
--FILE--
18+
<?php
19+
ob_start();
20+
phpinfo();
21+
$s = ob_get_contents();
22+
ob_end_clean();
23+
preg_match('/curl\n\n(.+)\n\n/siU', $s, $m);
24+
25+
echo $m[1], "\n";
26+
27+
?>
28+
--EXPECTF--
29+
cURL support => enabled
30+
cURL Information => %s
31+
Age => %d
32+
Features
33+
AsynchDNS => Yes
34+
CharConv => No
35+
Debug => No
36+
GSS-Negotiate => Yes
37+
IDN => Yes
38+
IPv6 => Yes
39+
krb4 => No
40+
Largefile => Yes
41+
libz => Yes
42+
NTLM => Yes
43+
NTLMWB => No
44+
SPNEGO => No
45+
SSL => Yes
46+
SSPI => Yes
47+
TLS-SRP => No
48+
TrackMemory => No
49+
HTTP2 => Yes
50+
GSSAPI => Yes
51+
KERBEROS5 => Yes
52+
UNIX_SOCKETS => Yes
53+
PSL => Yes
54+
HTTPS_PROXY => Yes
55+
MULTI_SSL => %s
56+
BROTLI => %s
57+
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp
58+
Host => %s-pc-win32
59+
SSL Version => OpenSSL/%s
60+
ZLib Version => %s
61+
libSSH Version => libssh2/%s

ext/curl/tests/check_win_config.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ krb4 => No
3535
Largefile => Yes
3636
libz => Yes
3737
NTLM => Yes
38+
TrackMemory => No
3839
NTLMWB => No
3940
SPNEGO => Yes
4041
SSL => Yes

0 commit comments

Comments
 (0)