check for PQconninfo
authorMichael Wallner <mike@php.net>
Wed, 15 Oct 2014 16:38:12 +0000 (18:38 +0200)
committerMichael Wallner <mike@php.net>
Wed, 15 Oct 2014 16:38:12 +0000 (18:38 +0200)
config.m4
package.xml
php_pq.h
src/php_pqconn.c

index ed20d5620964ea98c6da02ed0e6c277cb0adf9d0..0ec1dbd1abe63498e287d5922253e75caeebc98a 100644 (file)
--- 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)])
                -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\
        
        PQ_SRC="\
                src/php_pq_module.c\
index e6b1d8a5b0d12f6ecf4b0c9d6e9ffcd3c207835a..07843f882f0117180c8a39fa84f0562a5d611720 100644 (file)
@@ -33,7 +33,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </lead>
  <date>2014-10-15</date>
  <version>
  </lead>
  <date>2014-10-15</date>
  <version>
-  <release>0.5.0</release>
+  <release>0.5.1</release>
   <api>0.5.0</api>
  </version>
  <stability>
   <api>0.5.0</api>
  </version>
  <stability>
@@ -42,24 +42,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-+ Published documentation at http://devel-m6w6.rhcloud.com/mdref/pq
-+ Added pq\Connection::$params
-+ Added pq\Connection::declare(), pq\Connection::declareAsync() and pq\Cursor
-+ Added pq\Connection::unlisten() and pq\Connection::off()
-+ Added pq\Connection::$defaultFetchType, pq\Connection::$defaultTransactionIsolation, 
-  pq\Connection::$defaultTransactionReadonly and pq\Connection::$defaultTransactionDeferrable
-+ Added pq\Connection::$defaultAutoConvert and pq\Result::$autoConvert
-+ Added pq\Result::CONV_BOOL, pq\Result::CONV_INT, pq\Result::CONV_FLOAT, pq\Result::CONV_SCALAR,
-  pq\Result::CONV_ARRAY, pq\Result::CONV_DATETIME, pq\Result::CONV_JSON and pq\Result::CONV_ALL
-+ Always declare pq\Types OID constants
-+ Added pq\Result::fetchAllCols()
-- Reverse arguments of pq\Result::fetchCol()
-- Attempt to access properties of objects that have not been initialized by its constructor will throw E_RECOVERABLE_ERROR
-- Renamed pq\ConverterInterface to pq\Converter
-- Added second argument "$type" to pq\Converter::convertFromString() and pq\Converter::convertToString() 
-* Fixed wakeup of persistent connections to ping the server with an empty query and eventually reset the connection
-* Fixed possible invalid free and leak
-* Fixed a possible crash
++ Fixed build with PostgreSQL <= 9.2
 ]]></notes>
  <contents>
   <dir name="/">
 ]]></notes>
  <contents>
   <dir name="/">
index f3d829a995392052f803f8ebe9dfdc27e289ae64..ffb93618685c03dbe4d83121a1a523eb203bf172 100644 (file)
--- a/php_pq.h
+++ b/php_pq.h
@@ -14,7 +14,7 @@
 #ifndef PHP_PQ_H
 #define PHP_PQ_H
 
 #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;
 
 int pq_module_number;
 zend_module_entry pq_module_entry;
index 7b1fbd926d49e7e2f32150449d4c2ccfc77f83c5..f30b3a8316ebf0b2661e373ecae23ac0f0592f64 100644 (file)
@@ -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;
 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);
        }
 }
                PQconninfoFree(params);
        }
 }
+#endif
 
 static void php_pqconn_object_read_options(zval *object, void *o, zval *return_value TSRMLS_DC)
 {
 
 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);
 
        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);
        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;
 
        zend_declare_property_null(php_pqconn_class_entry, ZEND_STRL("options"), ZEND_ACC_PUBLIC TSRMLS_CC);
        ph.read = php_pqconn_object_read_options;