[xdebug-dev] xdebug xdebug/xdebug_var.c - Use the API call for fetching a class name.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sat, 22 Aug 2009 14:18:06 +0200

Date: Sat Aug 22 14:18:06 CEST 2009
User: Derick Rethans
Directory: xdebug

Log Message:
[2.50]
- Use the API call for fetching a class name.
#- Solves issues with PHP 5.2 and classes extended from internal classes.

Modified files:
           xdebug/xdebug_var.c (version: 1.100)

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- xdebug/xdebug_var.c:1.99 Thu Jul 16 21:01:00 2009 GMT
+++ xdebug/xdebug_var.c Sat Aug 22 10:18:06 2009 GMT
@@ -311,7 +311,12 @@
                 case IS_OBJECT:
                         myht = Z_OBJPROP_PP(struc);
                         if (myht->nApplyCount < 1) {
- xdebug_str_add(str, xdebug_sprintf("class %s { ", Z_OBJCE_PP(struc)->name), 1);
+ char *class_name;
+ zend_uint class_name_len;
+
+ zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
+ xdebug_str_add(str, xdebug_sprintf("class %s { ", class_name), 1);
+
                                 if (level <= options->max_depth) {
                                         options->runtime[level].current_element_nr = 0;
                                         options->runtime[level].start_element_nr = 0;
@@ -402,9 +407,14 @@
                         xdebug_str_add(str, xdebug_sprintf("array(%d)", myht->nNumOfElements), 1);
                         break;
 
- case IS_OBJECT:
- xdebug_str_add(str, xdebug_sprintf("class %s", Z_OBJCE_PP(struc)->name), 1);
+ case IS_OBJECT: {
+ char *class_name;
+ zend_uint class_name_len;
+
+ zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
+ xdebug_str_add(str, xdebug_sprintf("class %s", class_name), 1);
                         break;
+ }
 
                 case IS_RESOURCE: {
                         char *type_name;
@@ -536,7 +546,11 @@
                 case IS_OBJECT:
                         myht = Z_OBJPROP_PP(struc);
                         if (myht->nApplyCount < 1) {
- xdebug_str_add(str, xdebug_sprintf("<object class='%s'>", Z_OBJCE_PP(struc)->name), 1);
+ char *class_name;
+ zend_uint class_name_len;
+
+ zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
+ xdebug_str_add(str, xdebug_sprintf("<object class='%s'>", class_name), 1);
                                 zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export_xml, 2, level, str);
                                 xdebug_str_addl(str, "</object>", 9, 0);
                         } else {
@@ -753,7 +767,7 @@
 
                         xdebug_xml_add_attribute(node, "type", "object");
                         xdebug_xml_add_attribute(node, "children", (myht && zend_hash_num_elements(myht))?"1":"0");
- Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
+ zend_get_object_classname(*struc, &class_name, &class_name_len TSRMLS_CC);
                         xdebug_xml_add_attribute_ex(node, "classname", xdstrdup(class_name), 0, 1);
 
                         /** Temporary additional property **/
Received on Sat Aug 22 2009 - 14:18:12 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST