Jump to content

Dependency tree


ForumJoiner

Recommended Posts

I'm looking for a program or, better, for PHP scripts that can display a dependecy tree for my project.

More specific, I have a php script (called script1.php) that includes another 2 php scripts (called script21.php and script22.php), each of them including some files (called script21a.php, script21b.php, and script22a.php).
I need a software to make a tree like:

[code]script1.php
        - script21.php
                - script21a.php
                - script21b.php
        - script22.php
                - script22a.php [/code]



I would also like to see on this tree all the functions each file have.
I need too a list like:

[code]function name = fnc1 (from script1.php) called
        function name = fnc2 (from script2.php) (with parameters: pr1, pr2) [/code]


A name / pointer to resource would be perfect. Thank you.
Link to comment
https://forums.phpfreaks.com/topic/7547-dependency-tree/
Share on other sites

I'd create a db table, say, script_usage

script_usage
--------------
script_name
included_in


First part of the exercise would be a data collection script to read each of your script files looking for "include" or "require" then parsing for the included script name. Write the data to the table.

Second part would be a recursive script which would find script_usage records where the included_in matches the parent script, and for each one found, search for scripts included in that one and so on.

Functions would be simpler (no recursion)

[code]function
-----------
function_id
function_name
param_list
script_name[/code]
Link to comment
https://forums.phpfreaks.com/topic/7547-dependency-tree/#findComment-27534
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.