- add HttpDeflateStream and HttpInflateStream objects
[m6w6/ext-http] / http.c
diff --git a/http.c b/http.c
index 5da35c5e1ed2376ba07c0c6824159a19d142d2fa..14b25bcf49ab67e3cc2a52cdc554aa8af0a5527f 100644 (file)
--- a/http.c
+++ b/http.c
 #              include "php_http_request_object.h"
 #              include "php_http_requestpool_object.h"
 #      endif
+#      ifdef HTTP_HAVE_ZLIB
+#              include "php_http_deflatestream_object.h"
+#              include "php_http_inflatestream_object.h"
+#      endif
 #      include "php_http_exception_object.h"
 #endif
 
@@ -212,9 +216,9 @@ PHP_INI_BEGIN()
 #endif
        HTTP_PHP_INI_ENTRY("http.force_exit", "1", PHP_INI_ALL, OnUpdateBool, force_exit)
 #ifdef HTTP_HAVE_ZLIB
-       HTTP_PHP_INI_ENTRY("http.ob_inflate_auto", "0", PHP_INI_PERDIR, OnUpdateBool, send.inflate.start_auto)
+       HTTP_PHP_INI_ENTRY("http.ob_inflate_auto", "0", PHP_INI_ALL, OnUpdateBool, send.inflate.start_auto)
        HTTP_PHP_INI_ENTRY("http.ob_inflate_flags", "0", PHP_INI_ALL, OnUpdateLong, send.inflate.start_flags)
-       HTTP_PHP_INI_ENTRY("http.ob_deflate_auto", "0", PHP_INI_PERDIR, OnUpdateBool, send.deflate.start_auto)
+       HTTP_PHP_INI_ENTRY("http.ob_deflate_auto", "0", PHP_INI_ALL, OnUpdateBool, send.deflate.start_auto)
        HTTP_PHP_INI_ENTRY("http.ob_deflate_flags", "0", PHP_INI_ALL, OnUpdateLong, send.deflate.start_flags)
 #endif
 PHP_INI_END()
@@ -252,6 +256,10 @@ PHP_MINIT_FUNCTION(http)
                        (SUCCESS != PHP_MINIT_CALL(http_request_object))        ||
                        (SUCCESS != PHP_MINIT_CALL(http_requestpool_object))||
 #      endif /* HTTP_HAVE_CURL */
+#      ifdef HTTP_HAVE_ZLIB
+                       (SUCCESS != PHP_MINIT_CALL(http_deflatestream_object))  ||
+                       (SUCCESS != PHP_MINIT_CALL(http_inflatestream_object))  ||
+#      endif /* HTTP_HAVE_ZLIB */
                        (SUCCESS != PHP_MINIT_CALL(http_exception_object))) {
                return FAILURE;
        }
@@ -318,29 +326,8 @@ PHP_MINFO_FUNCTION(http)
 {
        php_info_print_table_start();
        {
-               php_info_print_table_row(2, "Extended HTTP support", "enabled");
+               php_info_print_table_row(2, "HTTP Support", "enabled");
                php_info_print_table_row(2, "Extension Version", PHP_EXT_HTTP_VERSION);
-#ifdef HTTP_HAVE_CURL
-               php_info_print_table_row(2, "cURL HTTP Requests", curl_version());
-#else
-               php_info_print_table_row(2, "cURL HTTP Requests", "disabled");
-#endif
-#ifdef HTTP_HAVE_ZLIB
-               {
-                       char my_zlib_version[64] = {0};
-                       
-                       strlcat(my_zlib_version, "zlib/", 63);
-                       strlcat(my_zlib_version, zlibVersion(), 63);
-                       php_info_print_table_row(2, "zlib GZIP Encodings", my_zlib_version);
-               }
-#else
-               php_info_print_table_row(2, "zlib GZIP Encodings", "disabled");
-#endif
-#if defined(HTTP_HAVE_MAGIC) && !defined(WONKY)
-               php_info_print_table_row(2, "magic MIME Guessing", "libmagic/unknown");
-#else
-               php_info_print_table_row(2, "magic MIME Guessing", "disabled");
-#endif
                php_info_print_table_row(2, "Registered Classes",
 #ifndef ZEND_ENGINE_2
                        "none"
@@ -359,6 +346,28 @@ PHP_MINFO_FUNCTION(http)
        }
        php_info_print_table_end();
        
+       php_info_print_table_start();
+       php_info_print_table_header(3, "Used Library", "Compiled", "Linked");
+       {
+#ifdef HTTP_HAVE_CURL
+               curl_version_info_data *cv = curl_version_info(CURLVERSION_NOW);
+               php_info_print_table_row(3, "libcurl", LIBCURL_VERSION, cv->version);
+#else
+               php_info_print_table_row(2, "libcurl", "disabled", "disabled");
+#endif
+#ifdef HTTP_HAVE_ZLIB
+               php_info_print_table_row(3, "libz", ZLIB_VERSION, zlibVersion());
+#else
+               php_info_print_table_row(3, "libz", "disabled", "disabled");
+#endif
+#if defined(HTTP_HAVE_MAGIC) && !defined(WONKY)
+               php_info_print_table_row(3, "libmagic", "unknown", "unknown");
+#else
+               php_info_print_table_row(3, "libmagic", "disabled", "disabled");
+#endif
+       }
+       php_info_print_table_end();
+       
        php_info_print_table_start();
        php_info_print_table_colspan_header(2, "Request Methods");
        {