php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #62410
Patch property-overloading-php-5.4-support revision 2012-06-25 19:29 UTC by lars at strojny dot net
Patch property-overloading-v1.diff revision 2012-06-25 19:23 UTC by lars at strojny dot net

Patch property-overloading-v1.diff for amqp Bug #62410

Patch version 2012-06-25 19:23 UTC

Return to Bug #62410 | Download this patch
Patch Revisions:

Developer: lars@strojny.net

diff --git a/amqp_channel.c b/amqp_channel.c
index 98ebc3a..1e05376 100644
--- a/amqp_channel.c
+++ b/amqp_channel.c
@@ -96,11 +96,13 @@ void amqp_channel_dtor(void *object TSRMLS_DC)
 zend_object_value amqp_channel_ctor(zend_class_entry *ce TSRMLS_DC)
 {
 	zend_object_value new_value;
+	zval *tmp;
 	amqp_channel_object *channel = (amqp_channel_object*)emalloc(sizeof(amqp_channel_object));
 
 	memset(channel, 0, sizeof(amqp_channel_object));
 
 	zend_object_std_init(&channel->zo, ce TSRMLS_CC);
+	zend_hash_copy(channel->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
 	new_value.handle = zend_objects_store_put(
 		channel,
diff --git a/amqp_connection.c b/amqp_connection.c
index f8e80da..419aee0 100644
--- a/amqp_connection.c
+++ b/amqp_connection.c
@@ -332,11 +332,13 @@ void amqp_connection_dtor(void *object TSRMLS_DC)
 zend_object_value amqp_connection_ctor(zend_class_entry *ce TSRMLS_DC)
 {
 	zend_object_value new_value;
+	zval *tmp;
 
 	amqp_connection_object* connection = (amqp_connection_object*)emalloc(sizeof(amqp_connection_object));
 	memset(connection, 0, sizeof(amqp_connection_object));
 
 	zend_object_std_init(&connection->zo, ce TSRMLS_CC);
+	zend_hash_copy(connection->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
 	new_value.handle = zend_objects_store_put(
 		connection,
diff --git a/amqp_envelope.c b/amqp_envelope.c
index 25ea253..4692a63 100644
--- a/amqp_envelope.c
+++ b/amqp_envelope.c
@@ -152,6 +152,7 @@ void amqp_envelope_dtor(void *object TSRMLS_DC)
 zend_object_value amqp_envelope_ctor(zend_class_entry *ce TSRMLS_DC)
 {
 	zend_object_value new_value;
+	zval *tmp;
 	amqp_envelope_object *envelope = (amqp_envelope_object*)emalloc(sizeof(amqp_envelope_object));
 
 	memset(envelope, 0, sizeof(amqp_envelope_object));
@@ -160,6 +161,7 @@ zend_object_value amqp_envelope_ctor(zend_class_entry *ce TSRMLS_DC)
 	array_init(envelope->headers);
 
 	zend_object_std_init(&envelope->zo, ce TSRMLS_CC);
+	zend_hash_copy(envelope->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
 	new_value.handle = zend_objects_store_put(envelope, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)amqp_envelope_dtor, NULL TSRMLS_CC);
 
diff --git a/amqp_exchange.c b/amqp_exchange.c
index 40da25f..38c30a1 100644
--- a/amqp_exchange.c
+++ b/amqp_exchange.c
@@ -101,6 +101,7 @@ void amqp_exchange_dtor(void *object TSRMLS_DC)
 zend_object_value amqp_exchange_ctor(zend_class_entry *ce TSRMLS_DC)
 {
 	zend_object_value new_value;
+	zval *tmp;
 	amqp_exchange_object* exchange = (amqp_exchange_object*)emalloc(sizeof(amqp_exchange_object));
 
 	memset(exchange, 0, sizeof(amqp_exchange_object));
@@ -110,6 +111,7 @@ zend_object_value amqp_exchange_ctor(zend_class_entry *ce TSRMLS_DC)
 	array_init(exchange->arguments);
 
 	zend_object_std_init(&exchange->zo, ce TSRMLS_CC);
+	zend_hash_copy(exchange->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
 	new_value.handle = zend_objects_store_put(
 		exchange,
diff --git a/amqp_queue.c b/amqp_queue.c
index f6107c7..4d83421 100644
--- a/amqp_queue.c
+++ b/amqp_queue.c
@@ -112,11 +112,13 @@ void amqp_queue_dtor(void *object TSRMLS_DC)
 zend_object_value amqp_queue_ctor(zend_class_entry *ce TSRMLS_DC)
 {
 	zend_object_value new_value;
+	zval *tmp;
 	amqp_queue_object* queue = (amqp_queue_object*)emalloc(sizeof(amqp_queue_object));
 
 	memset(queue, 0, sizeof(amqp_queue_object));
 
 	zend_object_std_init(&queue->zo, ce TSRMLS_CC);
+	zend_hash_copy(queue->zo.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
 	// Initialize the arguments array:
 	MAKE_STD_ZVAL(queue->arguments);
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 02:03:34 2021 UTC