* zval_add_ref() expects zval **
[m6w6/ext-http] / http.c
diff --git a/http.c b/http.c
index c68f61d33740edadcb30c762f0adf6fbba3bec69..32d9e2aa85554197c93e07f7c033579eb0eaedd2 100644 (file)
--- a/http.c
+++ b/http.c
@@ -22,9 +22,7 @@
 
 #ifdef HTTP_HAVE_CURL
 #      ifdef PHP_WIN32
-#              define _WINSOCKAPI_
 #              include <winsock2.h>
-#              include <sys/types.h>
 #      endif
 #      include <curl/curl.h>
 #endif
@@ -310,6 +308,10 @@ zend_function_entry httpi_request_class_methods[] = {
 
        PHP_ME(HTTPi_Request, setOptions, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(HTTPi_Request, getOptions, NULL, ZEND_ACC_PUBLIC)
+       PHP_ME(HTTPi_Request, unsetOptions, NULL, ZEND_ACC_PUBLIC)
+       
+       PHP_ME(HTTPi_Request, addHeader, NULL, ZEND_ACC_PUBLIC)
+       PHP_ME(HTTPi_Request, addCookie, NULL, ZEND_ACC_PUBLIC)
 
        PHP_ME(HTTPi_Request, setMethod, NULL, ZEND_ACC_PUBLIC)
        PHP_ME(HTTPi_Request, getMethod, NULL, ZEND_ACC_PUBLIC)
@@ -507,16 +509,37 @@ PHP_RSHUTDOWN_FUNCTION(http)
 /* {{{ PHP_MINFO_FUNCTION */
 PHP_MINFO_FUNCTION(http)
 {
-       php_info_print_table_start();
-       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:",
+#ifdef ZEND_ENGINE_2
+#      define HTTP_FUNC_AVAIL(CLASS) "procedural, object oriented (class " CLASS ")"
+#else
+#      define HTTP_FUNC_AVAIL(CLASS) "procedural"
+#endif
+
 #ifdef HTTP_HAVE_CURL
-                       "enabled"
+#      define HTTP_CURL_VERSION curl_version()
+#      ifdef ZEND_ENGINE_2
+#              define HTTP_CURL_AVAIL(CLASS) "procedural, object oriented (class " CLASS ")"
+#      else
+#              define HTTP_CURL_AVAIL(CLASS) "procedural"
+#      endif
 #else
-                       "disabled"
+#      define HTTP_CURL_VERSION "libcurl not available"
+#      define HTTP_CURL_AVAIL(CLASS) "libcurl not available"
 #endif
-       );
+
+       char full_version_string[1024] = {0};
+       snprintf(full_version_string, 1023, "%s (%s)", PHP_EXT_HTTP_VERSION, HTTP_CURL_VERSION);
+
+       php_info_print_table_start();
+       php_info_print_table_row(2, "Extended HTTP support", "enabled");
+       php_info_print_table_row(2, "Extension Version:", full_version_string);
+       php_info_print_table_end();
+
+       php_info_print_table_start();
+       php_info_print_table_header(2, "Functionality",            "Availability");
+       php_info_print_table_row(2,    "Miscellaneous Utilities:", HTTP_FUNC_AVAIL("HTTPi"));
+       php_info_print_table_row(2,    "Extended HTTP Responses:", HTTP_FUNC_AVAIL("HTTPi_Response"));
+       php_info_print_table_row(2,    "Extended HTTP Requests:",  HTTP_CURL_AVAIL("HTTPi_Request"));
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();