cvs: ZendEngine2 / zend_reflection_api.c

From: Date: Tue, 02 Sep 2003 14:46:03 +0000
Subject: cvs: ZendEngine2 / zend_reflection_api.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1794@lists.php.net to get a copy of this message
helly Tue Sep 2 10:46:03 2003 EDT Modified files: /ZendEngine2 zend_reflection_api.c Log: Use appropriate function for property name unmangling. # Make Andrey happy Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.53 ZendEngine2/zend_reflection_api.c:1.54 --- ZendEngine2/zend_reflection_api.c:1.53 Tue Sep 2 10:11:53 2003 +++ ZendEngine2/zend_reflection_api.c Tue Sep 2 10:46:02 2003 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.53 2003/09/02 14:11:53 helly Exp $ */ +/* $Id: zend_reflection_api.c,v 1.54 2003/09/02 14:46:02 helly Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_default_classes.h" @@ -429,6 +429,8 @@ static void _property_string(string *str, zend_property_info *prop, char* indent TSRMLS_DC) { + char *class_name, *prop_name; + string_printf(str, "%sProperty [ %s", indent, (prop->flags & ZEND_ACC_IMPLICIT_PUBLIC) ? "<implicit> " : "<default> "); @@ -447,15 +449,9 @@ if(prop->flags & ZEND_ACC_STATIC) { string_printf(str, "static "); } - /* Unmangle the property name if necessary */ - string_printf(str, "$"); - if (prop->name[0] != 0) { - string_write(str, prop->name, prop->name_length); - } else { - char* tmp; - tmp= prop->name + 1; - string_printf(str, tmp + strlen(tmp) + 1); - } + + unmangle_property_name(prop->name, &class_name, &prop_name); + string_printf(str, "$%s", prop_name); string_printf(str, " ]\n"); } @@ -579,18 +575,13 @@ zval *name; zval *classname; property_reference *reference; + char *class_name, *prop_name; - MAKE_STD_ZVAL(name); + unmangle_property_name(prop->name, &class_name, &prop_name); - /* Unmangle the property name if necessary */ - if (prop->name[0] != 0) { - ZVAL_STRINGL(name, prop->name, prop->name_length, 1); - } else { - char* tmp; + MAKE_STD_ZVAL(name); + ZVAL_STRING(name, prop_name, 1); - tmp= prop->name + 1; - ZVAL_STRING(name, tmp + strlen(tmp) + 1, 1); - } MAKE_STD_ZVAL(classname); ZVAL_STRINGL(classname, ce->name, ce->name_length, 1); reflection_instanciate(reflection_property_ptr, object TSRMLS_CC);

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