Jump to content


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


Dependency tree

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:

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

Share this post

Link to post
Share on other sites
I'd create a db table, say, script_usage


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)


Share this post

Link to post
Share on other sites


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.