- require libcurl-7.12.3
[m6w6/ext-http] / http_request_object.c
index 43cf5a805ea0660905d66367f33493d81711383f..2e34c919e52cf467adc184bc89a615225056a6c1 100644 (file)
 
 /* $Id$ */
 
-
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
 #endif
-#include "php.h"
+
+#define HTTP_WANT_CURL
+#include "php_http.h"
 
 #if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
 
 #include "zend_interfaces.h"
 
-#include "php_http_std_defs.h"
-#include "php_http_request_object.h"
-#include "php_http_request_api.h"
-#include "php_http_request_pool_api.h"
-#include "php_http.h"
 #include "php_http_api.h"
-#include "php_http_url_api.h"
+#include "php_http_exception_object.h"
 #include "php_http_message_api.h"
 #include "php_http_message_object.h"
-#include "php_http_exception_object.h"
-
-#include "missing.h"
-
-#ifdef PHP_WIN32
-#      include <winsock2.h>
-#endif
-#include <curl/curl.h>
+#include "php_http_request_api.h"
+#include "php_http_request_object.h"
+#include "php_http_request_pool_api.h"
+#include "php_http_url_api.h"
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
@@ -413,12 +405,10 @@ static inline void _http_request_object_declare_default_properties(TSRMLS_D)
        /*
         * Auth Constants
         */
-#      if LIBCURL_VERSION_NUM >= 0x070a05
        DCL_CONST(long, "AUTH_BASIC", CURLAUTH_BASIC);
        DCL_CONST(long, "AUTH_DIGEST", CURLAUTH_DIGEST);
        DCL_CONST(long, "AUTH_NTLM", CURLAUTH_NTLM);
        DCL_CONST(long, "AUTH_ANY", CURLAUTH_ANY);
-#      endif /* LIBCURL_VERSION_NUM */
 #endif /* WONKY */
 }
 
@@ -1045,7 +1035,7 @@ PHP_METHOD(HttpRequest, getUrl)
  * Set the request method.
  * 
  * Expects an int as parameter specifying the request method to use.
- * In PHP 5.1+ HttpRequest::METH, otherwise the HTTP_METH constants can be used.
+ * In PHP 5.1+ HttpRequest::METH_*, otherwise the HTTP_METH_* constants can be used.
  * 
  * Returns TRUE on success, or FALSE on failure.
  */
@@ -1967,7 +1957,7 @@ PHP_METHOD(HttpRequest, clearHistory)
  * GET example:
  * <pre>
  * <?php
- * $r = new HttpRequest('http://example.com/feed.rss', HTTP_GET);
+ * $r = new HttpRequest('http://example.com/feed.rss', HttpRequest::METH_GET);
  * $r->setOptions(array('lastmodified' => filemtime('local.rss')));
  * $r->addQueryData(array('category' => 3));
  * try {
@@ -1984,7 +1974,7 @@ PHP_METHOD(HttpRequest, clearHistory)
  * POST example:
  * <pre>
  * <?php
- * $r = new HttpRequest('http://example.com/form.php', HTTP_POST);
+ * $r = new HttpRequest('http://example.com/form.php', HttpRequest::METH_POST);
  * $r->setOptions(array('cookies' => array('lang' => 'de')));
  * $r->addPostFields(array('user' => 'mike', 'pass' => 's3c|r3t'));
  * $r->addPostFile('image', 'profile.jpg', 'image/jpeg');