]> granicus.if.org Git - php/commitdiff
Add a compile check for the cURL version and fix the compile in general.
authorSterling Hughes <sterling@php.net>
Wed, 16 May 2001 23:43:30 +0000 (23:43 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 16 May 2001 23:43:30 +0000 (23:43 +0000)
ext/curl/config.m4
ext/curl/curl.c
ext/curl/php_curl.h

index cdccaa7eb47a9d0a786a95d06607efd45806a5df..3bad5d4793a86260a2cda0c25db1bc58e68c5ba6 100644 (file)
@@ -23,6 +23,21 @@ if test "$PHP_CURL" != "no"; then
     easy.h should be in <curl-dir>/include/curl/)
   fi
 
+  CURL_CONFIG="curl-config"
+  AC_MSG_CHECKING(for cURL greater than 7.7.3)
+
+  if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then
+    CURL_CONFIG=${CURL_DIR}/bin/curl-config
+  fi
+
+  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 7007003; then
+    AC_MSG_RESULT($curl_version_full)
+  else
+    AC_MSG_ERROR(cURL version 7.7.3 or later is required to compile php with cURL support)
+  fi
+
   PHP_ADD_INCLUDE($CURL_DIR/include)
 
   PHP_SUBST(CURL_SHARED_LIBADD)
index 3666bd364491c491976f27f87ade187b2bd1945e..14bed9afeca16ee307f50cfacf5e685f72c9b379 100644 (file)
@@ -187,7 +187,7 @@ PHP_MINIT_FUNCTION(curl)
        REGISTER_CURL_CONSTANT("CURLOPT_CONNECTTIMEOUT",  CURLOPT_CONNECTTIMEOUT);
        REGISTER_CURL_CONSTANT("CURLOPT_SSL_VERIFYPEER",  CURLOPT_SSL_VERIFYPEER);
        REGISTER_CURL_CONSTANT("CURLOPT_CAINFO",          CURLOPT_CAINFO);
-       REGISTER_CURL_CONSTANT("CURLOPT_BINARYTRANSER",   CURLOPT_BINARY);
+       REGISTER_CURL_CONSTANT("CURLOPT_BINARYTRANSER",   CURLOPT_BINARYTRANSFER);
        
        /* Constants effecting the way CURLOPT_CLOSEPOLICY works */
        REGISTER_CURL_CONSTANT("CURLCLOSEPOLICY_LEAST_RECENTLY_USED", CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
index 2800f324d46a412395a3a270784440154479c9fb..49d2d6c99f87331772cfd7ee8b42342725d91690 100644 (file)
@@ -57,6 +57,7 @@ typedef struct {
        FILE         *fp;
        smart_str     buf;
        int           method;
+       int           type;
 } php_curl_write;
 
 typedef struct {