cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Sun, 09 Oct 2005 17:14:16 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4220@lists.php.net to get a copy of this message | ||
helly Sun Oct 9 13:14:16 2005 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
- Add 'overwrites' info to method dump
# Right now we have to compute that information because it is not available
http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.184&r2=1.185&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.184 ZendEngine2/zend_reflection_api.c:1.185
--- ZendEngine2/zend_reflection_api.c:1.184 Sat Oct 8 19:37:31 2005
+++ ZendEngine2/zend_reflection_api.c Sun Oct 9 13:14:15 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.184 2005/10/08 23:37:31 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.185 2005/10/09 17:14:15 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
@@ -639,6 +639,9 @@
static void _function_string(string *str, zend_function *fptr, zend_class_entry *scope, char*
indent TSRMLS_DC)
{
string param_indent;
+ zend_function *overwrites;
+ char *lc_name;
+ unsigned int lc_name_len;
/* TBD: Repair indenting of doc comment (or is this to be done in the parser?)
* What's "wrong" is that any whitespace before the doc comment start is
@@ -653,8 +656,18 @@
if (fptr->type == ZEND_INTERNAL_FUNCTION && ((zend_internal_function*)fptr)->module)
{
string_printf(str, ":%s", ((zend_internal_function*)fptr)->module->name);
}
- if (scope && fptr->common.scope && fptr->common.scope != scope) {
- string_printf(str, ", inherits %v", fptr->common.scope->name);
+ if (scope && fptr->common.scope) {
+ if (fptr->common.scope != scope) {
+ string_printf(str, ", inherits %v", fptr->common.scope->name);
+ } else if (fptr->common.scope->parent) {
+ lc_name = zend_u_str_case_fold(IS_STRING, fptr->common.function_name,
strlen(fptr->common.function_name), 1, &lc_name_len);
+ if (zend_u_hash_find(&fptr->common.scope->parent->function_table, IS_STRING,
lc_name, lc_name_len + 1, (void**) &overwrites) == SUCCESS) {
+ if (fptr->common.scope != overwrites->common.scope) {
+ string_printf(str, ", overwrites %v", overwrites->common.scope->name);
+ }
+ }
+ efree(lc_name);
+ }
}
if (fptr->common.prototype && fptr->common.prototype->common.scope) {
string_printf(str, ", prototype %v",
fptr->common.prototype->common.scope->name);