- fix build on Debian systems where access to Curl_* functions is prohibited
authorMichael Wallner <mike@php.net>
Wed, 31 May 2006 17:39:13 +0000 (17:39 +0000)
committerMichael Wallner <mike@php.net>
Wed, 31 May 2006 17:39:13 +0000 (17:39 +0000)
config.m4
config.w32
http.c
http_functions.c
http_request_object.c
package2.xml
php_http.h

index 555bbc7..0339acc 100644 (file)
--- 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 ----
index c82eca4..c07e9d2 100644 (file)
@@ -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 (file)
--- 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)
index adb44d2..0462c3b 100644 (file)
@@ -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 */
 
index d90803d..40e36bc 100644 (file)
@@ -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;
index ad3f4af..4c0c11c 100644 (file)
@@ -30,7 +30,7 @@ support. Parallel requests are available for PHP 5 and greater.
  </lead>
  <date>2006-00-00</date>
  <version>
-  <release>1.0.0RC5</release>
+  <release>1.0.0-dev</release>
   <api>1.0.0</api>
  </version>
  <stability>
@@ -39,15 +39,7 @@ support. Parallel requests are available for PHP 5 and greater.
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-+ Added HttpRequest::enableCookies() and HttpRequest::resetCookies([bool session_only=FALSE])
-+ Added optional flags argument to http_parse_params()
-+ Added HTTP_PARAMS_ALLOW_COMMA, HTTP_PARAMS_ALLOW_FAILURE, HTTP_PARAMS_RAISE_ERROR constants
-* Fixed http_build_url("./path") if REQUEST_URI is empty
-* Fixed http_parse_params("foo;bar") returning "foo" and "ar"
-* Fixed return value of http_parse_params() Object{"params"=>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
 ]]></notes>
  <contents>
   <dir name="/">
index 09010f8..c45c319 100644 (file)
@@ -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);