- fix builds and tests without libcurl linked in
authorMichael Wallner <mike@php.net>
Wed, 3 Aug 2005 08:50:39 +0000 (08:50 +0000)
committerMichael Wallner <mike@php.net>
Wed, 3 Aug 2005 08:50:39 +0000 (08:50 +0000)
http.c
http_request_api.c
php_http_request_api.h
php_http_request_pool_api.h
tests/HttpRequestPool_001.phpt
tests/HttpRequest_001.phpt
tests/HttpRequest_002.phpt
tests/HttpRequest_003.phpt
tests/skip.inc

diff --git a/http.c b/http.c
index 548c39158bf64d901389b0620d808ab26d089287..1516aa7ce753f600fb1249cdea70a71b639338c2 100644 (file)
--- a/http.c
+++ b/http.c
@@ -29,7 +29,9 @@
 #include "php_http_std_defs.h"
 #include "php_http_api.h"
 #include "php_http_send_api.h"
-#include "php_http_request_api.h"
+#ifdef HTTP_HAVE_CURL
+#      include "php_http_request_api.h"
+#endif
 
 #ifdef ZEND_ENGINE_2
 #      include "php_http_util_object.h"
@@ -286,6 +288,7 @@ PHP_MINFO_FUNCTION(http)
        }
        php_info_print_table_end();
 
+#ifdef HTTP_HAVE_CURL
        php_info_print_table_start();
        {
                unsigned i;
@@ -314,6 +317,7 @@ PHP_MINFO_FUNCTION(http)
                phpstr_free(custom_request_methods);
        }
        php_info_print_table_end();
+#endif
 
        php_info_print_table_start();
        {
index b6c2e833c8b5bf0808a65b8b41f4ae04a501048d..5bb5b6580ad203939f80d56d1a34fcdeb75987e9 100644 (file)
@@ -20,6 +20,8 @@
 #endif
 #include "php.h"
 
+#ifdef HTTP_HAVE_CURL
+
 #include "php_http.h"
 #include "php_http_std_defs.h"
 #include "php_http_api.h"
@@ -972,6 +974,8 @@ static inline zval *_http_curl_getopt_ex(HashTable *options, char *key, size_t k
 }
 /* }}} */
 
+#endif
+
 /*
  * Local variables:
  * tab-width: 4
index ea7281ce7b640460c646862a6c440eb53f364077..437fc90045130dc58830aca89fe49b36ff39f9f7 100644 (file)
@@ -17,6 +17,7 @@
 
 #ifndef PHP_HTTP_REQUEST_API_H
 #define PHP_HTTP_REQUEST_API_H
+#ifdef HTTP_HAVE_CURL
 
 #include "php_http_std_defs.h"
 #include "phpstr/phpstr.h"
@@ -153,6 +154,7 @@ PHP_HTTP_API STATUS _http_request_ex(CURL *ch, http_request_method meth, char *U
 #define http_put(u, b, o, i, r) _http_request_ex(NULL, HTTP_PUT, (u), (b), (o), (i), (r) TSRMLS_CC)
 #define http_put_ex(c, u, b, o, i, r) _http_request_ex((c), HTTP_PUT, (u), (b), (o), (i), (r) TSRMLS_CC)
 
+#endif
 #endif
 
 /*
@@ -163,3 +165,4 @@ PHP_HTTP_API STATUS _http_request_ex(CURL *ch, http_request_method meth, char *U
  * vim600: noet sw=4 ts=4 fdm=marker
  * vim<600: noet sw=4 ts=4
  */
+
index d357596ca611552b74d90af65af1d0fdd13e339f..9f870057306d6defc901f3e544a3ec70f298cd94 100644 (file)
@@ -17,6 +17,7 @@
 
 #ifndef PHP_HTTP_REQUEST_POOL_API_H
 #define PHP_HTTP_REQUEST_POOL_API_H
+#ifdef HTTP_HAVE_CURL
 
 #include "php_http_std_defs.h"
 #include "php_http_request_api.h"
@@ -64,6 +65,7 @@ PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool);
 #define http_request_pool_dtor(p) _http_request_pool_dtor((p) TSRMLS_CC)
 PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool TSRMLS_DC);
 
+#endif
 #endif
 
 /*
index 8c1b05be4ace27a2be8e39f1039fd1fd6d488a7e..615bf6713c216382206804536c61fd59121761c8 100644 (file)
@@ -4,6 +4,7 @@ HttpRequestPool
 <?php
 include 'skip.inc';
 checkver(5);
+checkcls('HttpRequestPool');
 checkurl('www.php.net');
 checkurl('pear.php.net');
 checkurl('pecl.php.net');
index ec28bdfbe8f4b516bb1c2ba0ee8a70fb5642ffb8..27cd1a02cb563b92b843b638d0da1be89ced1c7f 100644 (file)
@@ -4,6 +4,7 @@ HttpRequest options
 <?php
 include 'skip.inc';
 checkver(5);
+checkcls('HttpRequest');
 ?>
 --FILE--
 <?php
index c0766b0f376ed92fd9b877d0c5ac7c9924015c96..f6f0f7439e6f5797d1fb5a7742152e2577e93c92 100644 (file)
@@ -4,6 +4,7 @@ HttpRequest GET/POST
 <?php
 include 'skip.inc';
 checkver(5);
+checkcls('HttpRequest');
 checkurl('www.google.com');
 ?>
 --FILE--
index d432c4358c0334468427f0d2a51beab91acea254..32b134cffb6092d10cee040c4b10e6873a3eff2c 100644 (file)
@@ -4,6 +4,7 @@ HttpRequest SSL
 <?php
 include 'skip.inc';
 checkver(5);
+checkcls('HttpRequest');
 checkurl('arweb.info');
 ?>
 --FILE--
index 98b15e3242235a8b8092aec39062df02fa9c09ba..09da16948c3a1adc24782a301573391803e8e6ca 100644 (file)
@@ -5,5 +5,6 @@ function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI');
 function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); }
 function checkver($ver) { skipif($ver > (int) PHP_VERSION, "need PHP v$ver"); }
 function checkurl($url) { skipif(!@fsockopen($url, 80), "$url not responsive"); }
+function checkcls($cls) { skipif(!class_exists($cls), "need class $cls"); }
 checkext('http');
 ?>