Skip to content

Request #72189 Add missing CURL_VERSION_* constants #4085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,28 @@ See also: https://wiki.php.net/rfc/deprecations_php_7_2
. PHP_FLOAT_MAX max representable float number
. PHP_OS_FAMILY current operating system family

- Curl:
. CURL_VERSION_ALTSVC
. CURL_VERSION_ASYNCHDNS
. CURL_VERSION_BROTLI
. CURL_VERSION_CONV
. CURL_VERSION_CURLDEBUG
. CURL_VERSION_DEBUG
. CURL_VERSION_GSSAPI
. CURL_VERSION_GSSNEGOTIATE
. CURL_VERSION_HTTPS_PROXY
. CURL_VERSION_IDN
. CURL_VERSION_KERBEROS5
. CURL_VERSION_LARGEFILE
. CURL_VERSION_MULTI_SSL
. CURL_VERSION_NTLM
. CURL_VERSION_NTLM_WB
. CURL_VERSION_PSL
. CURL_VERSION_SPNEGO
. CURL_VERSION_SSPI
. CURL_VERSION_TLSAUTH_SRP
. CURL_VERSION_UNIX_SOCKETS

- Fileinfo:
. FILEINFO_EXTENSION include list of possible file extensions

Expand Down
42 changes: 42 additions & 0 deletions ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURL_VERSION_SSL);

#if LIBCURL_VERSION_NUM >= 0x070a06 /* Available since 7.10.6 */
REGISTER_CURL_CONSTANT(CURL_VERSION_DEBUG);
REGISTER_CURL_CONSTANT(CURL_VERSION_GSSNEGOTIATE);
REGISTER_CURL_CONSTANT(CURL_VERSION_NTLM);
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
/* http authentication options */
REGISTER_CURL_CONSTANT(CURLAUTH_ANY);
Expand All @@ -934,6 +937,7 @@ PHP_MINIT_FUNCTION(curl)
#endif

#if LIBCURL_VERSION_NUM >= 0x070a07 /* Available since 7.10.7 */
REGISTER_CURL_CONSTANT(CURL_VERSION_ASYNCHDNS);
REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CONNECTCODE);
REGISTER_CURL_CONSTANT(CURLOPT_FTP_CREATE_MISSING_DIRS);
REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH);
Expand All @@ -951,6 +955,7 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V4);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V6);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_WHATEVER);
REGISTER_CURL_CONSTANT(CURL_VERSION_SPNEGO);
#endif

#if LIBCURL_VERSION_NUM >= 0x070b00 /* Available since 7.11.0 */
Expand All @@ -963,6 +968,14 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_NETRC_FILE);
#endif

#if LIBCURL_VERSION_NUM >= 0x070b01 /* Available since 7.11.1 */
REGISTER_CURL_CONSTANT(CURL_VERSION_LARGEFILE);
#endif

#if LIBCURL_VERSION_NUM >= 0x070c00 /* Available since 7.12.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_IDN);
#endif

#if LIBCURL_VERSION_NUM >= 0x070c02 /* Available since 7.12.2 */
REGISTER_CURL_CONSTANT(CURLFTPAUTH_DEFAULT);
REGISTER_CURL_CONSTANT(CURLFTPAUTH_SSL);
Expand All @@ -987,6 +1000,10 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLINFO_SSL_ENGINES);
#endif

#if LIBCURL_VERSION_NUM >= 0x070d02 /* Available since 7.13.2 */
REGISTER_CURL_CONSTANT(CURL_VERSION_SSPI);
#endif

#if LIBCURL_VERSION_NUM >= 0x070e01 /* Available since 7.14.1 */
REGISTER_CURL_CONSTANT(CURLINFO_COOKIELIST);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIELIST);
Expand Down Expand Up @@ -1014,6 +1031,7 @@ PHP_MINIT_FUNCTION(curl)
#endif

#if LIBCURL_VERSION_NUM >= 0x070f04 /* Available since 7.15.4 */
REGISTER_CURL_CONSTANT(CURL_VERSION_CONV);
REGISTER_CURL_CONSTANT(CURLINFO_FTP_ENTRY_PATH);
#endif

Expand Down Expand Up @@ -1158,6 +1176,7 @@ PHP_MINIT_FUNCTION(curl)
#endif

#if LIBCURL_VERSION_NUM >= 0x071306 /* Available since 7.19.6 */
REGISTER_CURL_CONSTANT(CURL_VERSION_CURLDEBUG);
REGISTER_CURL_CONSTANT(CURLOPT_SSH_KNOWNHOSTS);
#endif

Expand Down Expand Up @@ -1226,6 +1245,7 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_TLSAUTH_TYPE);
REGISTER_CURL_CONSTANT(CURLOPT_TLSAUTH_USERNAME);
REGISTER_CURL_CONSTANT(CURL_TLSAUTH_SRP);
REGISTER_CURL_CONSTANT(CURL_VERSION_TLSAUTH_SRP);
#endif

#if LIBCURL_VERSION_NUM >= 0x071506 /* Available since 7.21.6 */
Expand All @@ -1234,6 +1254,7 @@ PHP_MINIT_FUNCTION(curl)
#endif

#if LIBCURL_VERSION_NUM >= 0x071600 /* Available since 7.22.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_NTLM_WB);
REGISTER_CURL_CONSTANT(CURLAUTH_NTLM_WB);
REGISTER_CURL_CONSTANT(CURLGSSAPI_DELEGATION_FLAG);
REGISTER_CURL_CONSTANT(CURLGSSAPI_DELEGATION_POLICY_FLAG);
Expand Down Expand Up @@ -1306,6 +1327,7 @@ PHP_MINIT_FUNCTION(curl)
#endif

#if LIBCURL_VERSION_NUM >= 0x072600 /* Available since 7.38.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_GSSAPI);
REGISTER_CURL_CONSTANT(CURLAUTH_NEGOTIATE);
#endif

Expand All @@ -1314,6 +1336,9 @@ PHP_MINIT_FUNCTION(curl)
#endif

#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_KERBEROS5);
REGISTER_CURL_CONSTANT(CURL_VERSION_UNIX_SOCKETS);

REGISTER_CURL_CONSTANT(CURLOPT_UNIX_SOCKET_PATH);

REGISTER_CURL_CONSTANT(CURLPROTO_SMB);
Expand Down Expand Up @@ -1358,6 +1383,7 @@ PHP_MINIT_FUNCTION(curl)

#if LIBCURL_VERSION_NUM >= 0x072f00 /* Available since 7.47.0 */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2TLS);
REGISTER_CURL_CONSTANT(CURL_VERSION_PSL);
#endif

#if LIBCURL_VERSION_NUM >= 0x073000 /* Available since 7.48.0 */
Expand All @@ -1370,6 +1396,22 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_TCP_FASTOPEN);
#endif

#if LIBCURL_VERSION_NUM >= 0x073400 /* Available since 7.52.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_HTTPS_PROXY);
#endif

#if LIBCURL_VERSION_NUM >= 0x073800 /* Available since 7.56.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_MULTI_SSL);
#endif

#if LIBCURL_VERSION_NUM >= 0x073900 /* Available since 7.57.0 */
REGISTER_CURL_CONSTANT(CURL_VERSION_BROTLI);
#endif

#if LIBCURL_VERSION_NUM >= 0x074001 /* Available since 7.64.1 */
REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC);
#endif

#if CURLOPT_FTPASCII != 0
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
#endif
Expand Down