summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-03-31 01:18:32 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-03-31 01:18:32 +0000
commit7ff14124327887b34cf5c99f8475f1626b2a76c3 (patch)
tree0fc3b53fd6d57aeab6150d3c5e8ed72dd4a3f8c3
parentc5d35962d23df3ecedaf9892bf9a4d495840c5f1 (diff)
downloadphp-git-7ff14124327887b34cf5c99f8475f1626b2a76c3.tar.gz
Print PostgreSQL version number in phpinfo()
-rw-r--r--ext/pgsql/config.m43
-rw-r--r--ext/pgsql/pgsql.c3
-rw-r--r--ext/pgsql/php_pgsql.h4
3 files changed, 10 insertions, 0 deletions
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 <libpq/libpq-fs.h>
#endif
+#ifdef HAVE_PG_CONFIG_H
+#include <pg_config.h>
+#endif
+
#ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
const char * pg_encoding_to_char(int encoding);
#endif