From: Michael Wallner Date: Wed, 31 May 2006 17:39:13 +0000 (+0000) Subject: - fix build on Debian systems where access to Curl_* functions is prohibited X-Git-Tag: RELEASE_1_0_0~11 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=50343c32560e80c491911b107fab8217a35850eb - fix build on Debian systems where access to Curl_* functions is prohibited --- diff --git a/config.m4 b/config.m4 index 555bbc7..0339acc 100644 --- a/config.m4 +++ b/config.m4 @@ -159,6 +159,11 @@ dnl ---- [AC_DEFINE([HAVE_CURL_EASY_RESET], [1], [ ])], [ ], [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] ) + dnl Debian suddenly (>=7.14.1-2) hides all symbols not starting with "curl" + PHP_CHECK_LIBRARY(curl, Curl_getFormData, + [AC_DEFINE([HAVE_CURL_GETFORMDATA], [1], [ ])], [ ], + [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR] + ) fi dnl ---- diff --git a/config.w32 b/config.w32 index c82eca4..c07e9d2 100644 --- a/config.w32 +++ b/config.w32 @@ -104,6 +104,7 @@ if (PHP_HTTP != "no") { AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, ""); AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, ""); AC_DEFINE("HAVE_CURL_EASY_RESET", 1, ""); + AC_DEFINE("HAVE_CURL_GETFORMDATA", 1, ""); } else { WARNING("curl convenience functions not enabled; libraries and headers not found"); } diff --git a/http.c b/http.c index 1d33864..65c0d91 100644 --- a/http.c +++ b/http.c @@ -107,7 +107,9 @@ zend_function_entry http_functions[] = { PHP_FE(http_put_file, http_arg_pass_ref_4) PHP_FE(http_put_stream, http_arg_pass_ref_4) PHP_FE(http_request, http_arg_pass_ref_5) +#ifdef HAVE_CURL_GETFORMDATA PHP_FE(http_request_body_encode, NULL) +#endif #endif PHP_FE(http_request_method_register, NULL) PHP_FE(http_request_method_unregister, NULL) diff --git a/http_functions.c b/http_functions.c index adb44d2..0462c3b 100644 --- a/http_functions.c +++ b/http_functions.c @@ -1670,6 +1670,7 @@ PHP_FUNCTION(http_request) } /* }}} */ +#ifdef HAVE_CURL_GETFORMDATA static char *file_get_contents(char *file, size_t *len TSRMLS_DC) { php_stream *s = NULL; @@ -1763,6 +1764,7 @@ PHP_FUNCTION(http_request_body_encode) break; } } +#endif /* HAVE_CURL_GETFORMDATA */ #endif /* HTTP_HAVE_CURL */ /* }}} HAVE_CURL */ diff --git a/http_request_object.c b/http_request_object.c index d90803d..40e36bc 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -234,10 +234,12 @@ HTTP_BEGIN_ARGS(methodExists, 1) HTTP_ARG_VAL(method, 0) HTTP_END_ARGS; +#ifdef HAVE_CURL_GETFORMDATA HTTP_BEGIN_ARGS(encodeBody, 2) HTTP_ARG_VAL(fields, 0) HTTP_ARG_VAL(files, 0) HTTP_END_ARGS; +#endif #define OBJ_PROP_CE http_request_object_ce zend_class_entry *http_request_object_ce; @@ -323,9 +325,9 @@ zend_function_entry http_request_object_fe[] = { HTTP_REQUEST_ALIAS(methodUnregister, http_request_method_unregister) HTTP_REQUEST_ALIAS(methodName, http_request_method_name) HTTP_REQUEST_ALIAS(methodExists, http_request_method_exists) - +#if HAVE_CURL_GETFORMDATA HTTP_REQUEST_ALIAS(encodeBody, http_request_body_encode) - +#endif EMPTY_FUNCTION_ENTRY }; static zend_object_handlers http_request_object_handlers; diff --git a/package2.xml b/package2.xml index ad3f4af..4c0c11c 100644 --- a/package2.xml +++ b/package2.xml @@ -30,7 +30,7 @@ support. Parallel requests are available for PHP 5 and greater. 2006-00-00 - 1.0.0RC5 + 1.0.0-dev 1.0.0 @@ -39,15 +39,7 @@ support. Parallel requests are available for PHP 5 and greater. BSD, revised Array("value", Array("name"=>"value"), ...)} -* Fixed HttpMessage::setRequestMethod() errenously issuing a warning about an unknown request method -* Fixed bugs introduced by using the new REQUEST_TIME server variable -! NOTE: Many INI settings have been renamed to comply with the internal structure +* Fixed build on Debian systems where access to Curl_* functions is prohibited ]]> diff --git a/php_http.h b/php_http.h index 09010f8..c45c319 100644 --- a/php_http.h +++ b/php_http.h @@ -15,7 +15,7 @@ #ifndef PHP_EXT_HTTP_H #define PHP_EXT_HTTP_H -#define PHP_EXT_HTTP_VERSION "1.0.0RC5" +#define PHP_EXT_HTTP_VERSION "1.0.0-dev" #ifdef HAVE_CONFIG_H # include "config.h" @@ -180,7 +180,9 @@ PHP_FUNCTION(http_put_data); PHP_FUNCTION(http_put_file); PHP_FUNCTION(http_put_stream); PHP_FUNCTION(http_request); +#ifdef HAVE_CURL_GETFORMDATA PHP_FUNCTION(http_request_body_encode); +#endif /* HAVE_CURL_GETFORMDATA */ #endif /* HTTP_HAVE_CURL */ PHP_FUNCTION(http_request_method_register); PHP_FUNCTION(http_request_method_unregister);