summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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