- 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 555bbc7185d84f8c7e04e2f36cbb48bc0b4223ce..0339acc3e74177b5cd3f6f71e0a8197cf69b9271 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 c82eca464f9848b4825a7273e072141e41c1b186..c07e9d25116c9f12484413a8a2ce228d8471c073 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 1d338647995718d39b9507eb3dfdca16de379ded..65c0d91c8918a3cd015fe053522f0fe0f7fde5d4 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 adb44d2bb40671551bef04900554915dc12387c5..0462c3b760b24aea0b31bd10ac51dea9e5f050a8 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 d90803db8ce87cdda5b273dd53d68b4b5202075f..40e36bc61586bdd986fe959e6bc16944958688e6 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 ad3f4af177f4de1cb92ee3e0f2113b5c247bcbfa..4c0c11c0233967cf85bf39830465c4efc32d67ff 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 09010f8e1685dfc940cbab433308b7e7662958ba..c45c319dee9b792c911bb1cd00b7283d4fcfc38e 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);