X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http.c;h=4130bce904c027369227bc119d7189ef59423da1;hp=f9bb4d09c886f4e049e852d9b983e38194821eee;hb=01751b935246b4483a50cbfca959de221e353085;hpb=a5e66b221dbf5a52cc770f4d7f46f05fe88784ba diff --git a/src/php_http.c b/src/php_http.c index f9bb4d0..4130bce 100644 --- a/src/php_http.c +++ b/src/php_http.c @@ -12,15 +12,15 @@ #include "php_http_api.h" -#include -#include +#include "php_ini.h" +#include "ext/standard/info.h" #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,9 +28,13 @@ # endif # endif #endif -#if PHP_HTTP_HAVE_IDN2 +#if PHP_HTTP_HAVE_LIBICU +# include +#endif +#if PHP_HTTP_HAVE_LIBIDN2 # include -#elif PHP_HTTP_HAVE_IDN +#endif +#if PHP_HTTP_HAVE_LIBIDN # include #endif @@ -140,9 +144,10 @@ 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) #endif || SUCCESS != PHP_MINIT_CALL(http_url) || SUCCESS != PHP_MINIT_CALL(http_env) @@ -164,7 +169,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 @@ -201,7 +206,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); @@ -210,22 +215,47 @@ 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 php_info_print_table_end();