diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-12-19 23:16:06 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-12-19 23:23:56 +0100 |
commit | 161fd757731d788bde09ea611a1c1538ffea6494 (patch) | |
tree | 5891d4f676c8d8479991e9d9df3ca601be756267 /ext/curl | |
parent | fc46c4b1061f54246a754dd7a32a41902062e652 (diff) | |
download | php-git-161fd757731d788bde09ea611a1c1538ffea6494.tar.gz |
Bump libcurl requirement to 7.12.1
The existence of the following functions is now guaranteed:
* curl_reset()
* curl_strerror()
* curl_multi_strerror()
* curl_share_strerror()
libcurl 7.12.1 has been released more than 13 years ago and is
available even in RHEL 4.
Diffstat (limited to 'ext/curl')
-rw-r--r-- | ext/curl/config.m4 | 10 | ||||
-rw-r--r-- | ext/curl/interface.c | 55 | ||||
-rw-r--r-- | ext/curl/multi.c | 2 | ||||
-rw-r--r-- | ext/curl/php_curl.h | 4 | ||||
-rw-r--r-- | ext/curl/share.c | 2 |
5 files changed, 12 insertions, 61 deletions
diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index 8e688c1a11..ce977e2a06 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -30,12 +30,12 @@ if test "$PHP_CURL" != "no"; then fi if test -n "$PKNAME"; then - AC_MSG_CHECKING(for cURL 7.10.5 or greater) + AC_MSG_CHECKING(for cURL 7.12.1 or greater) if $PKG_CONFIG --atleast-version 7.10.5 $PKNAME; then curl_version_full=`$PKG_CONFIG --modversion $PKNAME` AC_MSG_RESULT($curl_version_full) else - AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support) + AC_MSG_ERROR(cURL version 7.12.1 or later is required to compile php with cURL support) fi CURL_LIBS=`$PKG_CONFIG --libs $PKNAME` @@ -65,7 +65,7 @@ if test "$PHP_CURL" != "no"; then fi CURL_CONFIG="curl-config" - AC_MSG_CHECKING(for cURL 7.10.5 or greater) + AC_MSG_CHECKING(for cURL 7.12.1 or greater) if ${CURL_DIR}/bin/curl-config --libs > /dev/null 2>&1; then CURL_CONFIG=${CURL_DIR}/bin/curl-config @@ -77,13 +77,13 @@ if test "$PHP_CURL" != "no"; then curl_version_full=`$CURL_CONFIG --version` curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | $AWK 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - if test "$curl_version" -ge 7010005; then + if test "$curl_version" -ge 7012001; then AC_MSG_RESULT($curl_version_full) CURL_LIBS=`$CURL_CONFIG --libs` CURL_INCL=`$CURL_CONFIG --cflags` CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL` else - AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support) + AC_MSG_ERROR(cURL version 7.12.1 or later is required to compile php with cURL support) fi fi diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 9be6ba1c30..ef0bc09497 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -343,11 +343,9 @@ ZEND_BEGIN_ARG_INFO(arginfo_curl_close, 0) ZEND_ARG_INFO(0, ch) ZEND_END_ARG_INFO() -#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ ZEND_BEGIN_ARG_INFO(arginfo_curl_reset, 0) ZEND_ARG_INFO(0, ch) ZEND_END_ARG_INFO() -#endif #if LIBCURL_VERSION_NUM > 0x070f03 /* 7.15.4 */ ZEND_BEGIN_ARG_INFO(arginfo_curl_escape, 0) @@ -407,7 +405,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_curl_multi_errno, 0) ZEND_ARG_INFO(0, mh) ZEND_END_ARG_INFO() -#if LIBCURL_VERSION_NUM >= 0x070c00 /* Available since 7.12.0 */ ZEND_BEGIN_ARG_INFO(arginfo_curl_strerror, 0) ZEND_ARG_INFO(0, errornum) ZEND_END_ARG_INFO() @@ -419,7 +416,6 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_curl_share_strerror, 0) ZEND_ARG_INFO(0, errornum) ZEND_END_ARG_INFO() -#endif ZEND_BEGIN_ARG_INFO(arginfo_curl_share_init, 0) ZEND_END_ARG_INFO() @@ -465,14 +461,10 @@ static const zend_function_entry curl_functions[] = { PHP_FE(curl_error, arginfo_curl_error) PHP_FE(curl_errno, arginfo_curl_errno) PHP_FE(curl_close, arginfo_curl_close) -#if LIBCURL_VERSION_NUM >= 0x070c00 /* 7.12.0 */ PHP_FE(curl_strerror, arginfo_curl_strerror) PHP_FE(curl_multi_strerror, arginfo_curl_multi_strerror) PHP_FE(curl_share_strerror, arginfo_curl_share_strerror) -#endif -#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ PHP_FE(curl_reset, arginfo_curl_reset) -#endif #if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */ PHP_FE(curl_escape, arginfo_curl_escape) PHP_FE(curl_unescape, arginfo_curl_unescape) @@ -553,34 +545,22 @@ PHP_MINFO_FUNCTION(curl) unsigned int i; static const struct feat feats[] = { -#if LIBCURL_VERSION_NUM >= 0x070a07 /* 7.10.7 */ {"AsynchDNS", CURL_VERSION_ASYNCHDNS}, -#endif #if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */ {"CharConv", CURL_VERSION_CONV}, #endif -#if LIBCURL_VERSION_NUM >= 0x070a06 /* 7.10.6 */ {"Debug", CURL_VERSION_DEBUG}, {"GSS-Negotiate", CURL_VERSION_GSSNEGOTIATE}, -#endif -#if LIBCURL_VERSION_NUM >= 0x070c00 /* 7.12.0 */ {"IDN", CURL_VERSION_IDN}, -#endif {"IPv6", CURL_VERSION_IPV6}, {"krb4", CURL_VERSION_KERBEROS4}, -#if LIBCURL_VERSION_NUM >= 0x070b01 /* 7.11.1 */ {"Largefile", CURL_VERSION_LARGEFILE}, -#endif {"libz", CURL_VERSION_LIBZ}, -#if LIBCURL_VERSION_NUM >= 0x070a06 /* 7.10.6 */ {"NTLM", CURL_VERSION_NTLM}, -#endif #if LIBCURL_VERSION_NUM >= 0x071600 /* 7.22.0 */ {"NTLMWB", CURL_VERSION_NTLM_WB}, #endif -#if LIBCURL_VERSION_NUM >= 0x070a08 /* 7.10.8 */ {"SPNEGO", CURL_VERSION_SPNEGO}, -#endif {"SSL", CURL_VERSION_SSL}, #if LIBCURL_VERSION_NUM >= 0x070d02 /* 7.13.2 */ {"SSPI", CURL_VERSION_SSPI}, @@ -921,7 +901,7 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURL_VERSION_LIBZ); REGISTER_CURL_CONSTANT(CURL_VERSION_SSL); -#if LIBCURL_VERSION_NUM >= 0x070a06 /* Available since 7.10.6 */ + /* Available since 7.10.6 */ REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); /* http authentication options */ REGISTER_CURL_CONSTANT(CURLAUTH_ANY); @@ -931,15 +911,13 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE); REGISTER_CURL_CONSTANT(CURLAUTH_NONE); REGISTER_CURL_CONSTANT(CURLAUTH_NTLM); -#endif -#if LIBCURL_VERSION_NUM >= 0x070a07 /* Available since 7.10.7 */ + /* Available since 7.10.7 */ REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CONNECTCODE); REGISTER_CURL_CONSTANT(CURLOPT_FTP_CREATE_MISSING_DIRS); REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH); -#endif -#if LIBCURL_VERSION_NUM >= 0x070a08 /* Available since 7.10.8 */ + /* Available since 7.10.8 */ REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED); REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL); REGISTER_CURL_CONSTANT(CURLINFO_HTTPAUTH_AVAIL); @@ -951,9 +929,8 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V4); REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V6); REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_WHATEVER); -#endif -#if LIBCURL_VERSION_NUM >= 0x070b00 /* Available since 7.11.0 */ + /* Available since 7.11.0 */ REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED); REGISTER_CURL_CONSTANT(CURLFTPSSL_ALL); REGISTER_CURL_CONSTANT(CURLFTPSSL_CONTROL); @@ -961,7 +938,9 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLFTPSSL_TRY); REGISTER_CURL_CONSTANT(CURLOPT_FTP_SSL); REGISTER_CURL_CONSTANT(CURLOPT_NETRC_FILE); -#endif + + /* Available since 7.11.2 */ + REGISTER_CURL_CONSTANT(CURLOPT_TCP_NODELAY); #if LIBCURL_VERSION_NUM >= 0x070c02 /* Available since 7.12.2 */ REGISTER_CURL_CONSTANT(CURLFTPAUTH_DEFAULT); @@ -974,10 +953,6 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLOPT_FTP_ACCOUNT); #endif -#if LIBCURL_VERSION_NUM >= 0x070b02 /* Available since 7.11.2 */ - REGISTER_CURL_CONSTANT(CURLOPT_TCP_NODELAY); -#endif - #if LIBCURL_VERSION_NUM >= 0x070c02 /* Available since 7.12.2 */ REGISTER_CURL_CONSTANT(CURLINFO_OS_ERRNO); #endif @@ -1658,9 +1633,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx) ch->in_callback = 0; if (error == FAILURE) { php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_READFUNCTION"); -#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ length = CURL_READFUNC_ABORT; -#endif } else if (!Z_ISUNDEF(retval)) { _php_curl_verify_handlers(ch, 1); if (Z_TYPE(retval) == IS_STRING) { @@ -2176,21 +2149,13 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ case CURLOPT_UNRESTRICTED_AUTH: case CURLOPT_UPLOAD: case CURLOPT_VERBOSE: -#if LIBCURL_VERSION_NUM >= 0x070a06 /* Available since 7.10.6 */ case CURLOPT_HTTPAUTH: -#endif -#if LIBCURL_VERSION_NUM >= 0x070a07 /* Available since 7.10.7 */ case CURLOPT_FTP_CREATE_MISSING_DIRS: case CURLOPT_PROXYAUTH: -#endif -#if LIBCURL_VERSION_NUM >= 0x070a08 /* Available since 7.10.8 */ case CURLOPT_FTP_RESPONSE_TIMEOUT: case CURLOPT_IPRESOLVE: case CURLOPT_MAXFILESIZE: -#endif -#if LIBCURL_VERSION_NUM >= 0x070b02 /* Available since 7.11.2 */ case CURLOPT_TCP_NODELAY: -#endif #if LIBCURL_VERSION_NUM >= 0x070c02 /* Available since 7.12.2 */ case CURLOPT_FTPSSLAUTH: #endif @@ -2875,9 +2840,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{ case CURLOPT_COOKIEJAR: case CURLOPT_RANDOM_FILE: case CURLOPT_SSLCERT: -#if LIBCURL_VERSION_NUM >= 0x070b00 /* Available since 7.11.0 */ case CURLOPT_NETRC_FILE: -#endif #if LIBCURL_VERSION_NUM >= 0x071001 /* Available since 7.16.1 */ case CURLOPT_SSH_PRIVATE_KEYFILE: case CURLOPT_SSH_PUBLIC_KEYFILE: @@ -3449,7 +3412,6 @@ static void _php_curl_close(zend_resource *rsrc) } /* }}} */ -#if LIBCURL_VERSION_NUM >= 0x070c00 /* Available since 7.12.0 */ /* {{{ proto bool curl_strerror(int code) return string describing error code */ PHP_FUNCTION(curl_strerror) @@ -3469,9 +3431,7 @@ PHP_FUNCTION(curl_strerror) } } /* }}} */ -#endif -#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ /* {{{ _php_curl_reset_handlers() Reset all handlers of a given php_curl */ static void _php_curl_reset_handlers(php_curl *ch) @@ -3545,7 +3505,6 @@ PHP_FUNCTION(curl_reset) _php_curl_set_default_options(ch); } /* }}} */ -#endif #if LIBCURL_VERSION_NUM > 0x070f03 /* 7.15.4 */ /* {{{ proto void curl_escape(resource ch, string str) diff --git a/ext/curl/multi.c b/ext/curl/multi.c index d45802f71d..20d1363dac 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -439,7 +439,6 @@ PHP_FUNCTION(curl_multi_errno) } /* }}} */ -#if LIBCURL_VERSION_NUM >= 0x070c00 /* Available since 7.12.0 */ /* {{{ proto bool curl_multi_strerror(int code) return string describing error code */ PHP_FUNCTION(curl_multi_strerror) @@ -459,7 +458,6 @@ PHP_FUNCTION(curl_multi_strerror) } } /* }}} */ -#endif #if LIBCURL_VERSION_NUM >= 0x072C00 /* Available since 7.44.0 */ diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index ba0d7b0aef..616ad41eab 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -99,15 +99,11 @@ PHP_FUNCTION(curl_share_init); PHP_FUNCTION(curl_share_setopt); PHP_FUNCTION(curl_share_errno); -#if LIBCURL_VERSION_NUM >= 0x070c00 /* 7.12.0 */ PHP_FUNCTION(curl_strerror); PHP_FUNCTION(curl_multi_strerror); PHP_FUNCTION(curl_share_strerror); -#endif -#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */ PHP_FUNCTION(curl_reset); -#endif #if LIBCURL_VERSION_NUM >= 0x070f04 /* 7.15.4 */ PHP_FUNCTION(curl_escape); diff --git a/ext/curl/share.c b/ext/curl/share.c index d5ce75d239..b50a1b9e83 100644 --- a/ext/curl/share.c +++ b/ext/curl/share.c @@ -153,7 +153,6 @@ PHP_FUNCTION(curl_share_errno) /* }}} */ -#if LIBCURL_VERSION_NUM >= 0x070c00 /* Available since 7.12.0 */ /* {{{ proto bool curl_share_strerror(int code) return string describing error code */ PHP_FUNCTION(curl_share_strerror) @@ -173,7 +172,6 @@ PHP_FUNCTION(curl_share_strerror) } } /* }}} */ -#endif #endif |