diff --git a/ext/pdo_pgsql/config.w32 b/ext/pdo_pgsql/config.w32 index 6af9c98072a..3c74c9bf004 100644 --- a/ext/pdo_pgsql/config.w32 +++ b/ext/pdo_pgsql/config.w32 @@ -7,6 +7,11 @@ if (PHP_PDO_PGSQL != "no") { if (CHECK_LIB("libpq.lib", "pdo_pgsql", PHP_PDO_PGSQL) && CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) { EXTENSION("pdo_pgsql", "pdo_pgsql.c pgsql_driver.c pgsql_statement.c"); + + if (CHECK_HEADER_ADD_INCLUDE("pg_config.h", "CFLAGS_PDO_PGSQL", PHP_PDO_PGSQL + ";" + PHP_PHP_BUILD + "\\include\\pgsql")) { + ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PG_CONFIG_H"); + } + ADD_FLAG('CFLAGS_PDO_PGSQL', "/I ..\\pecl"); AC_DEFINE('HAVE_PDO_PGSQL', 1, 'Have PostgreSQL library'); ADD_FLAG('CFLAGS_PDO_PGSQL', "/D HAVE_PQPARAMETERSTATUS=1 /D HAVE_PQPROTOCOLVERSION=1 /D HAVE_PGTRANSACTIONSTATUS=1 /D HAVE_PQUNESCAPEBYTEA=1 /D HAVE_PQRESULTERRORFIELD=1"); diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index a81a00d7362..d3730afb903 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -30,6 +30,10 @@ #include "php_pdo_pgsql.h" #include "php_pdo_pgsql_int.h" +#ifdef HAVE_PG_CONFIG_H +#include +#endif + /* {{{ pdo_pgsql_functions[] */ zend_function_entry pdo_pgsql_functions[] = { {NULL, NULL, NULL} @@ -115,6 +119,12 @@ PHP_MINFO_FUNCTION(pdo_pgsql) { php_info_print_table_start(); php_info_print_table_header(2, "PDO Driver for PostgreSQL", "enabled"); +#ifdef HAVE_PG_CONFIG_H + php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION); +#endif + php_info_print_table_row(2, "Module version", pdo_pgsql_module_entry.version); + php_info_print_table_row(2, "Revision", " $Id$ "); + php_info_print_table_end(); } /* }}} */