summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2008-11-10 22:59:28 +0000
committerPierre Joye <pajoye@php.net>2008-11-10 22:59:28 +0000
commitdcdf00bdfca5d432998ac9fdf17f36212368d4ff (patch)
tree890bdc16f3b126cb88fd237f74540bd2354a00f4
parent493b0589e8c9f39dfb2d95e97deb63e98a074fba (diff)
downloadphp-git-dcdf00bdfca5d432998ac9fdf17f36212368d4ff.tar.gz
- MFH: make the curl phpinfo more verbose
-rw-r--r--ext/curl/interface.c89
1 files changed, 88 insertions, 1 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 4cadebcd1a..d375101a63 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -338,9 +338,96 @@ ZEND_GET_MODULE (curl)
*/
PHP_MINFO_FUNCTION(curl)
{
+
+
+ curl_version_info_data *d;
+ char **p;
+ char str[1024];
+ size_t n = 0;
+
+
+ d = curl_version_info(CURLVERSION_NOW);
php_info_print_table_start();
php_info_print_table_row(2, "cURL support", "enabled");
- php_info_print_table_row(2, "cURL Information", curl_version());
+ php_info_print_table_row(2, "cURL Information", d->version);
+ sprintf(str, "%d", d->age);
+ php_info_print_table_row(2, "Age", str);
+
+
+ if (d->features & CURL_VERSION_IPV6) {
+ n = sprintf(str, "%s", "IPv6-enabled, ");
+ }
+ if (d->features & CURL_VERSION_KERBEROS4) {
+ n += sprintf(str + n, "%s", "kerberos auth is supported, ");
+ }
+ if (d->features & CURL_VERSION_SSL) {
+ n += sprintf(str + n, "%s", "SSL options are present, ");
+ }
+ if (d->features & CURL_VERSION_LIBZ) {
+ n += sprintf(str + n, "%s", "libz features are present, ");
+ }
+ if (d->features & CURL_VERSION_NTLM) {
+ n += sprintf(str + n, "%s", "NTLM auth is supported, ");
+ }
+ if (d->features & CURL_VERSION_GSSNEGOTIATE) {
+ n += sprintf(str + n, "%s", "Negotiate auth support, ");
+ }
+ if (d->features & CURL_VERSION_DEBUG) {
+ n += sprintf(str + n, "%s", "built with debug capabilities, ");
+ }
+ if (d->features & CURL_VERSION_ASYNCHDNS) {
+ n += sprintf(str + n, "%s", "asynchronous dns resolves, ");
+ }
+ if (d->features & CURL_VERSION_SPNEGO) {
+ n += sprintf(str + n, "%s", "SPNEGO auth, ");
+ }
+ if (d->features & CURL_VERSION_LARGEFILE) {
+ n += sprintf(str + n, "%s", "supports files bigger than 2GB, ");
+ }
+ if (d->features & CURL_VERSION_IDN) {
+ n += sprintf(str + n, "%s", "International Domain Names support, ");
+ }
+ if (d->features & CURL_VERSION_SSPI) {
+ n += sprintf(str + n, "%s", "SSPI is supported, ");
+ }
+ if (d->features & CURL_VERSION_CONV) {
+ n += sprintf(str + n, "%s", "character conversions are supported, ");
+ }
+
+ if (n > 3) {
+ str[n - 2] = '\0';
+ }
+ php_info_print_table_row(2, "Features", str);
+ n = 0;
+ p = (char **) d->protocols;
+ while (*p != NULL) {
+ n += sprintf(str + n, "%s%s", *p, *(p + 1) != NULL ? ", " : "");
+ p++;
+ }
+ php_info_print_table_row(2, "Protocols", str);
+
+ php_info_print_table_row(2, "Host", d->host);
+
+ if (d->ssl_version) {
+ php_info_print_table_row(2, "SSL Version", d->ssl_version);
+ }
+
+ if (d->libz_version) {
+ php_info_print_table_row(2, "ZLib Version", d->libz_version);
+ }
+
+ if (d->libz_version) {
+ php_info_print_table_row(2, "libIDN Version", d->libidn);
+ }
+
+ if (d->iconv_ver_num) {
+ php_info_print_table_row(2, "IconV Version", d->iconv_ver_num);
+ }
+
+ if (d->libssh_version) {
+ php_info_print_table_row(2, "libSSH Version", d->libssh_version);
+ }
+
php_info_print_table_end();
}
/* }}} */