PHP_CHECK_LIBRARY(curl,curl_easy_init,
[
- AC_DEFINE(HAVE_CURL,1,[Have CURL easy support])
+ AC_DEFINE(HTTP_HAVE_CURL,1,[Have CURL easy support])
],[
AC_MSG_ERROR(There is something wrong with libcurl. Please check config.log for more information.)
],[
CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
- AC_DEFINE('HAVE_CURL', 1, 'Have CURL library');
+ AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
} else {
WARNING("curl convenience functions not enabled; libraries and headers not found");
}
#include "config.h"
#endif
-#if defined(HAVE_CURL) && HAVE_CURL
-# ifdef PHP_WIN32
-# include <winsock2.h>
-# include <sys/types.h>
-# endif
-#include <curl/curl.h>
-#endif
-
#include "php.h"
#include "snprintf.h"
#include "ext/standard/info.h"
#include "php_http.h"
#include "php_http_api.h"
+#ifdef HTTP_HAVE_CURL
+
+#ifdef PHP_WIN32
+#include <winsock2.h>
+#include <sys/types.h>
+#endif
+
+#include <curl/curl.h>
+#endif
+
ZEND_DECLARE_MODULE_GLOBALS(http)
#ifdef COMPILE_DL_HTTP
PHP_FE(http_send_stream, NULL)
PHP_FE(http_chunked_decode, NULL)
PHP_FE(http_split_response, NULL)
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
PHP_FE(http_get, NULL)
PHP_FE(http_head, NULL)
PHP_FE(http_post_data, NULL)
/* }}} */
/* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
/* {{{ proto string http_get(string url[, array options[, array &info]])
*
http_globals->ctype = NULL;
http_globals->etag = NULL;
http_globals->lmod = 0;
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
http_globals->curlbuf.body.data = NULL;
http_globals->curlbuf.body.used = 0;
http_globals->curlbuf.body.free = 0;
PHP_MINIT_FUNCTION(http)
{
ZEND_INIT_MODULE_GLOBALS(http, php_http_init_globals, NULL);
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
REGISTER_LONG_CONSTANT("HTTP_AUTH_BASIC", CURLAUTH_BASIC, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("HTTP_AUTH_DIGEST", CURLAUTH_DIGEST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("HTTP_AUTH_NTLM", CURLAUTH_NTLM, CONST_CS | CONST_PERSISTENT);
if (HTTP_G(etag)) {
efree(HTTP_G(etag));
}
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
if (HTTP_G(curlbuf).body.data) {
efree(HTTP_G(curlbuf).body.data);
}
php_info_print_table_header(2, "Extended HTTP support", "enabled");
php_info_print_table_row(2, "Version:", PHP_EXT_HTTP_VERSION);
php_info_print_table_row(2, "cURL convenience functions:",
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
"enabled"
#else
"disabled"
#include <ctype.h>
-#if defined(HAVE_CURL) && HAVE_CURL
-# ifdef PHP_WIN32
-# include <winsock2.h>
-# include <sys/types.h>
-# endif
-#include <curl/curl.h>
-#include <curl/easy.h>
-#endif
-
#include "php.h"
#include "php_version.h"
#include "php_streams.h"
#include "php_http.h"
#include "php_http_api.h"
+#ifdef HTTP_HAVE_CURL
+
+#ifdef PHP_WIN32
+#include <winsock2.h>
+#include <sys/types.h>
+#endif
+
+#include <curl/curl.h>
+#include <curl/easy.h>
+#endif
+
+
ZEND_DECLARE_MODULE_GLOBALS(http)
/* {{{ day/month names */
static int check_tzone(char *tzone);
/* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
#define http_curl_initbuf(m) _http_curl_initbuf((m) TSRMLS_CC)
static inline void _http_curl_initbuf(http_curlbuf_member member TSRMLS_DC);
#define http_curl_freebuf(m) _http_curl_freebuf((m) TSRMLS_CC)
/* }}} */
/* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
/* {{{ static inline void http_curl_initbuf(http_curlbuf_member) */
static inline void _http_curl_initbuf(http_curlbuf_member member TSRMLS_DC)
/* }}} */
/* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
/* {{{ STATUS http_get(char *, HashTable *, HashTable *, char **, size_t *) */
PHP_HTTP_API STATUS _http_get(const char *URL, HashTable *options,
PHP_FUNCTION(http_send_stream);
PHP_FUNCTION(http_chunked_decode);
PHP_FUNCTION(http_split_response);
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
PHP_FUNCTION(http_get);
PHP_FUNCTION(http_head);
PHP_FUNCTION(http_post_data);
char *ctype;
char *etag;
time_t lmod;
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
struct {
struct {
char *data;
#define HTTP_SERVER_VARS Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])
/* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
/* CURL buffer size */
#define HTTP_CURLBUF_BODYSIZE 16384
PHP_HTTP_API void _http_split_response(const zval *zresponse, zval *zheaders, zval *zbody TSRMLS_DC);
/* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && HAVE_CURL
+#ifdef HTTP_HAVE_CURL
#define http_get(u, o, i, d, l) _http_get((u), (o), (i), (d), (l) TSRMLS_CC)
PHP_HTTP_API STATUS _http_get(const char *URL, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC);