]> granicus.if.org Git - php/commitdiff
- Show dependencies in dump's too
authorMarcus Boerger <helly@php.net>
Mon, 20 Feb 2006 23:26:39 +0000 (23:26 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 20 Feb 2006 23:26:39 +0000 (23:26 +0000)
ext/reflection/php_reflection.c

index aa7644f7233726bcca6bd0dada337ac8a11383ce..cd0fcfaa8a6ed47fffcc70bcaac7b06381101394 100644 (file)
@@ -873,6 +873,41 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
                                  module->module_number, module->name,
                                  (module->version == NO_VERSION_YET) ? "<no_version>" : module->version);
 
+       if (module->deps) {
+               zend_module_dep* dep = module->deps;
+
+               string_printf(str, "\n  - Dependencies {\n");
+
+               while(dep->name) {
+                       string_printf(str, "%s    Dependency [ %s (", indent, dep->name);
+                       
+                       switch(dep->type) {
+                       case MODULE_DEP_REQUIRED:
+                               string_write(str, "Required", sizeof("Required") - 1);
+                               break;
+                       case MODULE_DEP_CONFLICTS:
+                               string_write(str, "Conflicts", sizeof("Conflicts") - 1);
+                               break;
+                       case MODULE_DEP_OPTIONAL:
+                               string_write(str, "Optional", sizeof("Optional") - 1);
+                               break;
+                       default:
+                               string_write(str, "Error", sizeof("Error") - 1); /* shouldn't happen */
+                               break;
+                       }
+
+                       if (dep->rel) { 
+                               string_printf(str, " %s", dep->rel);
+                       }
+                       if (dep->version) {     
+                               string_printf(str, " %s", dep->version);
+                       }
+                       string_write(str, ") ]\n", sizeof(") ]\n") - 1);
+                       dep++;
+               }
+               string_printf(str, "%s  }\n", indent);
+       }
+
        {
                string str_ini;
                string_init(&str_ini);