php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61511
Patch gnupg-1.3.2_PHP54.patch revision 2012-09-07 17:02 UTC by pristine dot source at gmail dot com
Patch gnupg-php54.patch revision 2012-05-10 09:29 UTC by massimiliano dot torromeo+pecl at gmail dot com

Patch gnupg-1.3.2_PHP54.patch for gnupg Bug #61511

Patch version 2012-09-07 17:02 UTC

Return to Bug #61511 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: pristine.source@gmail.com

diff -Naur gnupg-1.3.2/gnupg.c gnupg-1.3.2_PHP54/gnupg.c
--- gnupg-1.3.2/gnupg.c	1970-01-01 03:13:08.000000000 -0600
+++ gnupg-1.3.2_PHP54/gnupg.c	2012-09-07 11:31:03.496000000 -0500
@@ -158,6 +158,10 @@
 		return;
 	}
 	gnupg_free_resource_ptr(intern TSRMLS_CC);
+
+#if ZEND_MODULE_API_NO >= 20100525
+	intern->zo.properties_table = NULL;
+#endif
 	if(intern->zo.properties){
 		zend_hash_destroy(intern->zo.properties);
 		FREE_HASHTABLE(intern->zo.properties);
@@ -175,12 +179,17 @@
 	
 	intern					=	emalloc(sizeof(gnupg_object));
 	intern->zo.ce			=	class_type;
-	intern->zo.properties	=	NULL;
 	
-	ALLOC_HASHTABLE	(intern->zo.properties);
-	zend_hash_init	(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-	zend_hash_copy	(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 	
+	//object_properties_init
+	
+	
+	zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
+#if ZEND_MODULE_API_NO >= 20100525
+	object_properties_init(&intern->zo, class_type);
+#else
+	zend_hash_copy  (intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_property_ctor, (void *) &tmp, sizeof(zval *));
+#endif	
 	retval.handle		=	zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_obj_dtor,NULL TSRMLS_CC);
 	retval.handlers		=	(zend_object_handlers *) & gnupg_object_handlers;
 	gnupg_res_init	(intern TSRMLS_CC);
diff -Naur gnupg-1.3.2/gnupg_keylistiterator.c gnupg-1.3.2_PHP54/gnupg_keylistiterator.c
--- gnupg-1.3.2/gnupg_keylistiterator.c	1970-01-01 03:13:08.000000000 -0600
+++ gnupg-1.3.2_PHP54/gnupg_keylistiterator.c	2012-09-07 11:33:14.440000000 -0500
@@ -54,6 +54,9 @@
 /*
 	zval_dtor(&intern->pattern);
 */	
+#if ZEND_MODULE_API_NO >= 20100525
+	intern->zo.properties_table = NULL;
+#endif
 	if(intern->zo.properties){
 		zend_hash_destroy(intern->zo.properties);
 		FREE_HASHTABLE(intern->zo.properties);
@@ -70,7 +73,8 @@
 
 	intern =	emalloc(sizeof(gnupg_keylistiterator_object));
 	intern->zo.ce = class_type;
-	intern->zo.properties = NULL;
+	
+	zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
 	retval.handle   =   zend_objects_store_put(intern,NULL,(zend_objects_free_object_storage_t) gnupg_keylistiterator_dtor,NULL TSRMLS_CC);
 	retval.handlers	=	(zend_object_handlers *) & gnupg_keylistiterator_object_handlers;
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 18:01:29 2024 UTC