Script to find dependencies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
decepticon
Forum Newbie
Posts: 2
Joined: Wed Nov 16, 2005 9:25 am

Script to find dependencies

Post by decepticon »

Hi everyone,

I'm new to this forum...so I hope I can explain myself well, without sounding like a total idiot..but:

I was just wondering if there was an existing script out there, that will go through a bunch of php files, and find dependencies?

Reason being, is I am creating a UML diagram, and I just need to find out what script is dependant on what function(s) or script(s), and what that function is dependant on and vice versa.

So for example, if scriptA is modified or removed, ScriptC will be affected, which will then affect ScriptX, and so on....

Any help would be appreciated..

thanks!
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Interesting question. Just replying so its on my watched threads list, sorry.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Roja wrote:Interesting question. Just replying so its on my watched threads list, sorry.
FYI: There is a Watch this topic for replies link.


In other news, I haven't heard of a script that does that, but it wouldn't be too hard to do. Just open the root file, parse it for any occurrences of include(), include_once(), require(), require_once(), and record the files passed. Then, open up each of those files and search them for dependencies the same way - you could make a nice tree that way.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

pickle wrote:
Roja wrote:Interesting question. Just replying so its on my watched threads list, sorry.
FYI: There is a Watch this topic for replies link.
Yeah, but that does a totally different thing. I usually browse during the day with "Your Posts", which is quick. When I have time I expand my view to "Posts since you last visited". The watch the topic for replies I believe makes it PM you when there are updates, which I *absolutely* do not want.

Or put another way, thanks but I prefer my method. :P
Post Reply