From 62fd5b5f1e43cf04e0467a48578826726cfe5821 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 3 Aug 2005 08:50:39 +0000 Subject: [PATCH] - fix builds and tests without libcurl linked in --- http.c | 6 +++++- http_request_api.c | 4 ++++ php_http_request_api.h | 3 +++ php_http_request_pool_api.h | 2 ++ tests/HttpRequestPool_001.phpt | 1 + tests/HttpRequest_001.phpt | 1 + tests/HttpRequest_002.phpt | 1 + tests/HttpRequest_003.phpt | 1 + tests/skip.inc | 1 + 9 files changed, 19 insertions(+), 1 deletion(-) diff --git a/http.c b/http.c index 548c391..1516aa7 100644 --- 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(); { diff --git a/http_request_api.c b/http_request_api.c index b6c2e83..5bb5b65 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -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 diff --git a/php_http_request_api.h b/php_http_request_api.h index ea7281c..437fc90 100644 --- a/php_http_request_api.h +++ b/php_http_request_api.h @@ -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 */ + diff --git a/php_http_request_pool_api.h b/php_http_request_pool_api.h index d357596..9f87005 100644 --- a/php_http_request_pool_api.h +++ b/php_http_request_pool_api.h @@ -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 /* diff --git a/tests/HttpRequestPool_001.phpt b/tests/HttpRequestPool_001.phpt index 8c1b05b..615bf67 100644 --- a/tests/HttpRequestPool_001.phpt +++ b/tests/HttpRequestPool_001.phpt @@ -4,6 +4,7 @@ HttpRequestPool --FILE-- --FILE-- diff --git a/tests/HttpRequest_003.phpt b/tests/HttpRequest_003.phpt index d432c43..32b134c 100644 --- a/tests/HttpRequest_003.phpt +++ b/tests/HttpRequest_003.phpt @@ -4,6 +4,7 @@ HttpRequest SSL --FILE-- diff --git a/tests/skip.inc b/tests/skip.inc index 98b15e3..09da169 100644 --- a/tests/skip.inc +++ b/tests/skip.inc @@ -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'); ?> -- 2.30.2