summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2004-04-25 11:22:56 +0000
committerMarcus Boerger <helly@php.net>2004-04-25 11:22:56 +0000
commit286f75c891dcb642cbd36f2a22e01b606fd1fc29 (patch)
treeb9d08ed878bd8876c05db258133518e5f45a4db3 /ext/reflection/php_reflection.c
parent8116ba424973a6827b29233129eb70c4130d01ad (diff)
downloadphp-git-286f75c891dcb642cbd36f2a22e01b606fd1fc29.tar.gz
Show number of classes
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 8a533cfeed..87168ba5a5 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -679,11 +679,13 @@ static int _extension_class_string(zend_class_entry **pce, int num_args, va_list
string *str = va_arg(args, string *);
char *indent = va_arg(args, char *);
struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*);
+ int *num_classes = va_arg(args, int*);
if ((*pce)->module && !strcasecmp((*pce)->module->name, module->name)) {
TSRMLS_FETCH();
string_printf(str, "\n");
_class_string(str, *pce, NULL, indent TSRMLS_CC);
+ (*num_classes)++;
}
return ZEND_HASH_APPLY_KEEP;
}
@@ -736,13 +738,14 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
{
string str_classes;
string sub_indent;
+ int num_classes = 0;
string_init(&sub_indent);
string_printf(&sub_indent, "%s ", indent);
string_init(&str_classes);
- zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 3, &str_classes, sub_indent.string, module TSRMLS_CC);
- if (str_classes.len > 1) {
- string_printf(str, "\n - Classes {\n");
+ zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.string, module, &num_classes TSRMLS_CC);
+ if (num_classes) {
+ string_printf(str, "\n - Classes [%d] {\n", num_classes);
string_append(str, &str_classes);
string_printf(str, "%s }\n", indent);
}