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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.