From: Yasuo Ohgaki Date: Sun, 31 Mar 2002 01:18:32 +0000 (+0000) Subject: Print PostgreSQL version number in phpinfo() X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~953 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ff14124327887b34cf5c99f8475f1626b2a76c3;p=php Print PostgreSQL version number in phpinfo() --- diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index 85f8568510..c7abbbb3c9 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -23,6 +23,9 @@ if test "$PHP_PGSQL" != "no"; then if test -r "$i/$j/libpq-fe.h"; then PGSQL_INC_BASE=$i PGSQL_INCLUDE=$i/$j + if test -r "$i/$j/pg_config.h"; then + AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h]) + fi fi done diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 2d71c17507..413f4d2aba 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -399,6 +399,9 @@ PHP_MINFO_FUNCTION(pgsql) php_info_print_table_start(); php_info_print_table_header(2, "PostgreSQL Support", "enabled"); +#ifdef HAVE_PG_CONFIG_H + php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION); +#endif sprintf(buf, "%ld", PGG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); sprintf(buf, "%ld", PGG(num_links)); diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 03390696c5..85573d8ad8 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -38,6 +38,10 @@ extern zend_module_entry pgsql_module_entry; #include #endif +#ifdef HAVE_PG_CONFIG_H +#include +#endif + #ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT const char * pg_encoding_to_char(int encoding); #endif