zend_restore_error_handling(&zeh TSRMLS_CC);
if (SUCCESS == rv) {
+ php_pqlob_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
php_pqtxn_object_t *txn_obj = zend_object_store_get_object(ztxn TSRMLS_CC);
- if (!txn_obj->intern) {
+ if (obj->intern) {
+ throw_exce(EX_BAD_METHODCALL TSRMLS_CC, "pq\\LOB already initialized");
+ } else if (!txn_obj->intern) {
throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Transaction not initialized");
} else if (!txn_obj->intern->open) {
throw_exce(EX_RUNTIME TSRMLS_CC, "pq\\Transation already closed");
if (lofd < 0) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to open large object with oid=%u with mode '%s' (%s)", loid, strmode(mode), PHP_PQerrorMessage(txn_obj->intern->conn->intern->conn));
} else {
- php_pqlob_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
-
obj->intern = ecalloc(1, sizeof(*obj->intern));
obj->intern->lofd = lofd;
obj->intern->loid = loid;
{0}
};
+PHP_MSHUTDOWN_FUNCTION(pqlob)
+{
+ zend_hash_destroy(&php_pqlob_object_prophandlers);
+ return SUCCESS;
+}
+
PHP_MINIT_FUNCTION(pqlob)
{
zend_class_entry ce = {0};
php_pqlob_object_handlers.write_property = php_pq_object_write_prop;
php_pqlob_object_handlers.clone_obj = NULL;
php_pqlob_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqlob_object_handlers.get_gc = NULL;
php_pqlob_object_handlers.get_properties = php_pq_object_properties;
php_pqlob_object_handlers.get_debug_info = php_pq_object_debug_info;