cvs: ZendEngine2(PHP_5_0) / zend_API.c zend_API.h zend_reflection_api.c

From: Date: Sat, 22 Jan 2005 12:29:16 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / zend_API.c zend_API.h zend_reflection_api.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3324@lists.php.net to get a copy of this message
helly Sat Jan 22 07:29:16 2005 EDT Modified files: (Branch: PHP_5_0) /ZendEngine2 zend_API.c zend_API.h zend_reflection_api.c Log: - MFH bugfix #31651 http://cvs.php.net/diff.php/ZendEngine2/zend_API.c?r1=1.256.2.6&r2=1.256.2.7&ty=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.256.2.6 ZendEngine2/zend_API.c:1.256.2.7 --- ZendEngine2/zend_API.c:1.256.2.6 Sat Jan 15 16:13:34 2005 +++ ZendEngine2/zend_API.c Sat Jan 22 07:29:13 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.256.2.6 2005/01/15 21:13:34 andi Exp $ */ +/* $Id: zend_API.c,v 1.256.2.7 2005/01/22 12:29:13 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -687,6 +687,16 @@ } +ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) +{ + if (!class_type->constants_updated) { + zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + class_type->constants_updated = 1; + } +} + + /* This function requires 'properties' to contain all props declared in the * class and all props being public. If only a subset is given or the class * has protected members then you need to merge the properties seperately by @@ -701,11 +711,7 @@ zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name); } - if (!class_type->constants_updated) { - zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - class_type->constants_updated = 1; - } + zend_update_class_constants(class_type TSRMLS_CC); arg->type = IS_OBJECT; if (class_type->create_object == NULL) { http://cvs.php.net/diff.php/ZendEngine2/zend_API.h?r1=1.185.2.1&r2=1.185.2.2&ty=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.185.2.1 ZendEngine2/zend_API.h:1.185.2.2 --- ZendEngine2/zend_API.h:1.185.2.1 Thu Sep 9 05:53:20 2004 +++ ZendEngine2/zend_API.h Sat Jan 22 07:29:13 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.h,v 1.185.2.1 2004/09/09 09:53:20 helly Exp $ */ +/* $Id: zend_API.h,v 1.185.2.2 2005/01/22 12:29:13 helly Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -188,6 +188,7 @@ ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC); ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC); +ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC); ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC); ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC); ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC); http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.111.2.16&r2=1.111.2.17&ty=u Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.111.2.16 ZendEngine2/zend_reflection_api.c:1.111.2.17 --- ZendEngine2/zend_reflection_api.c:1.111.2.16 Mon Dec 27 10:14:58 2004 +++ ZendEngine2/zend_reflection_api.c Sat Jan 22 07:29:13 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.111.2.16 2004/12/27 15:14:58 helly Exp $ */ +/* $Id: zend_reflection_api.c,v 1.111.2.17 2005/01/22 12:29:13 helly Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_exceptions.h" @@ -2128,11 +2128,7 @@ METHOD_NOTSTATIC_NUMPARAMS(0); GET_REFLECTION_OBJECT_PTR(ce); - if (!ce->constants_updated) { - zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - zend_hash_apply_with_argument(ce->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); - ce->constants_updated = 1; - } + zend_update_class_constants(ce TSRMLS_CC); array_init(return_value); zend_hash_copy(Z_ARRVAL_P(return_value), ce->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); @@ -2151,6 +2147,8 @@ GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); + zend_update_class_constants(ce TSRMLS_CC); + count = zend_hash_num_elements(&ce->default_properties); if (count > 0) { HashPosition pos;

« previous php.zend-engine.cvs (#3324) next »