From 3fe349a4acbfc6bc777cae313742c5d87d651550 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 15 Oct 2014 18:38:12 +0200 Subject: [PATCH] check for PQconninfo --- config.m4 | 1 + package.xml | 21 ++------------------- php_pq.h | 2 +- src/php_pqconn.c | 4 ++++ 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/config.m4 b/config.m4 index ed20d56..0ec1dbd 100644 --- a/config.m4 +++ b/config.m4 @@ -31,6 +31,7 @@ if test "$PHP_PQ" != "no"; then -L$PQ_DIR/$PHP_LIBDIR ]) PHP_CHECK_LIBRARY(pq, PQlibVersion, [AC_DEFINE(HAVE_PQLIBVERSION, 1, Have PQlibVersion)]) + PHP_CHECK_LIBRARY(pq, PQconninfo, [AC_DEFINE(HAVE_PQCONNINFO, 1, Have PQconninfo)]) PQ_SRC="\ src/php_pq_module.c\ diff --git a/package.xml b/package.xml index e6b1d8a..07843f8 100644 --- a/package.xml +++ b/package.xml @@ -33,7 +33,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> 2014-10-15 - 0.5.0 + 0.5.1 0.5.0 @@ -42,24 +42,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> BSD, revised diff --git a/php_pq.h b/php_pq.h index f3d829a..ffb9361 100644 --- a/php_pq.h +++ b/php_pq.h @@ -14,7 +14,7 @@ #ifndef PHP_PQ_H #define PHP_PQ_H -#define PHP_PQ_VERSION "0.5.0" +#define PHP_PQ_VERSION "0.5.1" int pq_module_number; zend_module_entry pq_module_entry; diff --git a/src/php_pqconn.c b/src/php_pqconn.c index 7b1fbd9..f30b3a8 100644 --- a/src/php_pqconn.c +++ b/src/php_pqconn.c @@ -301,6 +301,7 @@ static void php_pqconn_object_read_port(zval *object, void *o, zval *return_valu } } +#if HAVE_PQCONNINFO static void php_pqconn_object_read_params(zval *object, void *o, zval *return_value TSRMLS_DC) { php_pqconn_object_t *obj = o; @@ -319,6 +320,7 @@ static void php_pqconn_object_read_params(zval *object, void *o, zval *return_va PQconninfoFree(params); } } +#endif static void php_pqconn_object_read_options(zval *object, void *o, zval *return_value TSRMLS_DC) { @@ -2044,9 +2046,11 @@ PHP_MINIT_FUNCTION(pqconn) ph.read = php_pqconn_object_read_port; zend_hash_add(&php_pqconn_object_prophandlers, "port", sizeof("port"), (void *) &ph, sizeof(ph), NULL); +#if HAVE_PQCONNINFO zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("params"), ZEND_ACC_PUBLIC TSRMLS_CC); ph.read = php_pqconn_object_read_params; zend_hash_add(&php_pqconn_object_prophandlers, "params", sizeof("params"), (void *) &ph, sizeof(ph), NULL); +#endif zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("options"), ZEND_ACC_PUBLIC TSRMLS_CC); ph.read = php_pqconn_object_read_options; -- 2.30.2