X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http.c;h=bc9166aa9596f7fbe4176a7bf9af4b520de01692;hp=cdd028730974f90077328a54e8d5b05a37fa1e9c;hb=8158548a80733b3af9539356b47527d960a13287;hpb=e761c34103c0c5316cce092ea42a789b95e887d2 diff --git a/src/php_http.c b/src/php_http.c index cdd0287..bc9166a 100644 --- a/src/php_http.c +++ b/src/php_http.c @@ -17,10 +17,10 @@ #include -#if PHP_HTTP_HAVE_CURL +#if PHP_HTTP_HAVE_LIBCURL # include -# if PHP_HTTP_HAVE_EVENT -# if PHP_HTTP_HAVE_EVENT2 +# if PHP_HTTP_HAVE_LIBEVENT +# if PHP_HTTP_HAVE_LIBEVENT2 # include # include # else @@ -28,15 +28,22 @@ # endif # endif #endif -#if PHP_HTTP_HAVE_IDN2 -# include -#elif PHP_HTTP_HAVE_IDN +#if PHP_HTTP_HAVE_LIBICU +# include +#endif +#if PHP_HTTP_HAVE_LIBIDN # include #endif +#if PHP_HTTP_HAVE_LIBIDN2 +# include +#endif +#if PHP_HTTP_HAVE_LIBIDNKIT2 || PHP_HTTP_HAVE_LIBIDNKIT +#include "idn/version.h" +#endif ZEND_DECLARE_MODULE_GLOBALS(php_http); -#ifdef COMPILE_DL_HTTP +#if COMPILE_DL_HTTP ZEND_GET_MODULE(http) #endif @@ -53,10 +60,10 @@ static zend_module_dep http_module_deps[] = { ZEND_MOD_REQUIRED("raphf") ZEND_MOD_REQUIRED("propro") ZEND_MOD_REQUIRED("spl") -#ifdef PHP_HTTP_HAVE_HASH +#if PHP_HTTP_HAVE_HASH ZEND_MOD_REQUIRED("hash") #endif -#ifdef PHP_HTTP_HAVE_ICONV +#if PHP_HTTP_HAVE_ICONV ZEND_MOD_REQUIRED("iconv") #endif {NULL, NULL, NULL, 0} @@ -106,20 +113,12 @@ static void php_http_globals_init_once(zend_php_http_globals *G) } #if 0 -static inline void php_http_globals_init(zend_php_http_globals *G TSRMLS_DC) -{ -} - -static inline void php_http_globals_free(zend_php_http_globals *G TSRMLS_DC) +static inline void php_http_globals_init(zend_php_http_globals *G) { } -#endif -#if ZTS && PHP_DEBUG && !HAVE_GCOV -zend_php_http_globals *php_http_globals(void) +static inline void php_http_globals_free(zend_php_http_globals *G) { - TSRMLS_FETCH(); - return PHP_HTTP_G; } #endif @@ -134,6 +133,7 @@ PHP_MINIT_FUNCTION(http) REGISTER_INI_ENTRIES(); if (0 + || SUCCESS != PHP_MINIT_CALL(http_object) || SUCCESS != PHP_MINIT_CALL(http_exception) || SUCCESS != PHP_MINIT_CALL(http_cookie) || SUCCESS != PHP_MINIT_CALL(http_encoding) @@ -147,7 +147,7 @@ PHP_MINIT_FUNCTION(http) || SUCCESS != PHP_MINIT_CALL(http_client) || SUCCESS != PHP_MINIT_CALL(http_client_request) || SUCCESS != PHP_MINIT_CALL(http_client_response) -#if PHP_HTTP_HAVE_CURL +#if PHP_HTTP_HAVE_LIBCURL || SUCCESS != PHP_MINIT_CALL(http_curl) || SUCCESS != PHP_MINIT_CALL(http_client_curl) || SUCCESS != PHP_MINIT_CALL(http_client_curl_user) @@ -172,7 +172,7 @@ PHP_MSHUTDOWN_FUNCTION(http) if (0 || SUCCESS != PHP_MSHUTDOWN_CALL(http_message) -#if PHP_HTTP_HAVE_CURL +#if PHP_HTTP_HAVE_LIBCURL || SUCCESS != PHP_MSHUTDOWN_CALL(http_client_curl) || SUCCESS != PHP_MSHUTDOWN_CALL(http_curl) #endif @@ -209,7 +209,7 @@ PHP_MINFO_FUNCTION(http) php_info_print_table_start(); php_info_print_table_header(3, "Used Library", "Compiled", "Linked"); php_info_print_table_row(3, "libz", ZLIB_VERSION, zlibVersion()); -#if PHP_HTTP_HAVE_CURL +#if PHP_HTTP_HAVE_LIBCURL { curl_version_info_data *cv = curl_version_info(CURLVERSION_NOW); php_info_print_table_row(3, "libcurl", LIBCURL_VERSION, cv->version); @@ -218,24 +218,58 @@ PHP_MINFO_FUNCTION(http) php_info_print_table_row(3, "libcurl", "disabled", "disabled"); #endif -#if PHP_HTTP_HAVE_EVENT +#if PHP_HTTP_HAVE_LIBEVENT php_info_print_table_row(3, "libevent", # ifdef LIBEVENT_VERSION LIBEVENT_VERSION, # else - PHP_HTTP_EVENT_VERSION, + PHP_HTTP_LIBEVENT_VERSION, # endif event_get_version()); #else php_info_print_table_row(3, "libevent", "disabled", "disabled"); #endif -#if PHP_HTTP_HAVE_IDN2 +#if PHP_HTTP_HAVE_LIBICU + { + UVersionInfo uv = {0}; + char us[U_MAX_VERSION_STRING_LENGTH] = {0}; + + u_getVersion(uv); + u_versionToString(uv, us); + php_info_print_table_row(3, "libicu " +#if HAVE_UIDNA_NAMETOASCII_UTF8 && HAVE_UIDNA_IDNTOASCII + "(IDNA2008/IDNA2003)" +#elif HAVE_UIDNA_NAMETOASCII_UTF8 + "(IDNA2008)" +#elif HAVE_UIDNA_IDNTOASCII + "(IDNA2003)" +#endif + , U_ICU_VERSION, us); + } +#else + php_info_print_table_row(3, "libicu (IDNA2008/IDNA2003)", "disabled", "disabled"); +#endif +#if PHP_HTTP_HAVE_LIBIDN2 php_info_print_table_row(3, "libidn2 (IDNA2008)", IDN2_VERSION, idn2_check_version(NULL)); -#elif PHP_HTTP_HAVE_IDN +#else + php_info_print_table_row(3, "libidn2 (IDNA2008)", "disabled", "disabled"); +#endif +#if PHP_HTTP_HAVE_LIBIDN php_info_print_table_row(3, "libidn (IDNA2003)", PHP_HTTP_LIBIDN_VERSION, "unknown"); +#else + php_info_print_table_row(3, "libidn (IDNA2003)", "disabled", "disabled"); +#endif +#if PHP_HTTP_HAVE_LIBIDNKIT2 + php_info_print_table_row(3, "libidnkit2 (IDNA2008)", IDNKIT_VERSION_LIBIDN, idn_version_libidn()); +#else + php_info_print_table_row(3, "libidnkit2 (IDNA2008)", "disabled", "disabled"); +#endif +#if PHP_HTTP_HAVE_LIBIDNKIT + php_info_print_table_row(3, "libidnkit (IDNA2003)", IDNKIT_VERSION, idn_version_getstring()); +#else + php_info_print_table_row(3, "libidnkit (IDNA2003)", "disabled", "disabled"); #endif - php_info_print_table_end(); DISPLAY_INI_ENTRIES();