X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=src%2Fphp_pqtxn.c;h=41b49508bf0581a940975e348e54fd6d599dd397;hb=0a542746bae981b2f44973b1b6ae8399ab8699eb;hp=5c2695f61d1ab24335c6d1a2626362af96cb5b1f;hpb=9f5cecf26bd70a92ed013f31afec59e272623ac1;p=m6w6%2Fext-pq diff --git a/src/php_pqtxn.c b/src/php_pqtxn.c index 5c2695f..41b4950 100644 --- a/src/php_pqtxn.c +++ b/src/php_pqtxn.c @@ -175,7 +175,7 @@ static void php_pqtxn_object_write_readonly(zval *object, void *o, zval *value T php_pqtxn_object_t *obj = o; PGresult *res; - if ((obj->intern->readonly = zend_is_true(value))) { + if ((obj->intern->readonly = z_is_true(value))) { res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION READ ONLY"); } else { res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION READ WRITE"); @@ -192,7 +192,7 @@ static void php_pqtxn_object_write_deferrable(zval *object, void *o, zval *value php_pqtxn_object_t *obj = o; PGresult *res; - if ((obj->intern->deferrable = zend_is_true(value))) { + if ((obj->intern->deferrable = z_is_true(value))) { res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION DEFERRABLE"); } else { res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION NOT DEFERRABLE"); @@ -872,6 +872,12 @@ static zend_function_entry php_pqtxn_methods[] = { {0} }; +PHP_MSHUTDOWN_FUNCTION(pqtxn) +{ + zend_hash_destroy(&php_pqtxn_object_prophandlers); + return SUCCESS; +} + PHP_MINIT_FUNCTION(pqtxn) { zend_class_entry ce = {0}; @@ -886,6 +892,8 @@ PHP_MINIT_FUNCTION(pqtxn) php_pqtxn_object_handlers.write_property = php_pq_object_write_prop; php_pqtxn_object_handlers.clone_obj = NULL; php_pqtxn_object_handlers.get_property_ptr_ptr = NULL; + php_pqtxn_object_handlers.get_gc = NULL; + php_pqtxn_object_handlers.get_properties = php_pq_object_properties; php_pqtxn_object_handlers.get_debug_info = php_pq_object_debug_info; zend_hash_init(&php_pqtxn_object_prophandlers, 4, NULL, NULL, 1);