Jump to content


Dependency tree

  • Please log in to reply
1 reply to this topic

#1 ForumJoiner

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 16 April 2006 - 03:48 PM

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

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

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

A name / pointer to resource would be perfect. Thank you.

#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 16 April 2006 - 07:19 PM

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)


If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users