* attempt to make http_build_query available for PHP4
[m6w6/ext-http] / http_api.c
index 064386e25f5fa11cc4bca54d75acea04d48ed92e..613d2597446b2cd2c02a121090990d1c4634d437 100644 (file)
 
 #include "SAPI.h"
 
-#if (PHP_MAJOR_VERSION >= 5)
+#ifdef ZEND_ENGINE_2
 #include "ext/standard/php_http.h"
 #else
-#include "php_http_build_query.h"
-#include "http_build_query.c"
+#include "php_http_build_query.c"
 #endif
 
 #include "php_http.h"
@@ -476,12 +475,9 @@ static inline void _http_curl_setopts(CURL *ch, const char *url, HashTable *opti
        curl_easy_setopt(ch, CURLOPT_AUTOREFERER, 1);
        curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, http_curl_body_callback);
        curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, http_curl_hdrs_callback);
-#if defined(ZTS)
+#ifdef ZTS
        curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1);
 #endif
-#if defined(PHP_DEBUG)
-       curl_easy_setopt(ch, CURLOPT_VERBOSE, 1);
-#endif
 
        if ((!options) || (1 > zend_hash_num_elements(options))) {
                return;
@@ -1088,12 +1084,6 @@ PHP_HTTP_API int _http_modified_match(const char *entry, const time_t t TSRMLS_D
                chr_ptr = 0;
        }
        retval = (t <= http_parse_date(modified));
-#if defined(PHP_DEBUG)
-       fprintf(stderr,
-               "\nComparing Last-Modified %s(%s)==%d:\n\t%d\n\t%d\n\n",
-               get_active_function_name(TSRMLS_C), entry, retval, t,
-               http_parse_date(modified));
-#endif
        efree(modified);
        return retval;
 }
@@ -1120,12 +1110,6 @@ PHP_HTTP_API int _http_etag_match(const char *entry, const char *etag TSRMLS_DC)
        } else {
                result = (NULL != strstr(Z_STRVAL_P(zetag), quoted_etag));
        }
-#if defined(PHP_DEBUG)
-       fprintf(stderr,
-               "\nComparing E-Tag %s(%s)==%d:\n\t<%s>\n\t<%s>\n\n",
-               get_active_function_name(TSRMLS_C), entry, result,
-               Z_STRVAL_P(zetag), quoted_etag);
-#endif
        efree(quoted_etag);
        return result;
 }