views:

247

answers:

4

Hello, Does something exist that I can point to my PHP project and it can look at all the files (or just the ones that I specify) and generate a diagram based on the objects and function calls? It would be a good way to verify that my design is actually being implimented :)

Background: I'm trying to build a PHP website using OO principles and while, so far, it is working I still have a ways to go and already the complexity is getting out of control. I mean, I understand basically what's going on but (and I don't think I'm alone here) it's really helpful to me if I can visualise the system at once and see the flow so I can optimise, remove unnecessary things and of course, build on the foundations. I could sit down with a pen&paper and draw it (and I have done that for parts) but if there was some program that would generate an image, it would be much simplier. Plus I could do it more often.

Thanks :)

+1  A: 

This answer is I think still valid for PHP, but I am not sure if it is totally what you want. I know some of the tools (e.g. Doxygen) work with PHP

Yacoby
nice one, I'll take a look at the various tools suggested in that thread. thanks :)
aland
+1 Doxygen is a GREAT tool.
spoulson
Doxygen does it! I had a problem with the calling graph not being displayed ('Error opening map file for inclusion in the docs'), but turned "SHORT_NAMES" on under Expert-Project and they are magically there :)
aland
+1  A: 

PHPDoc will create a class tree from your source code, but just in text (well, HTML). Not a pretty graph.

Dave Lancea
but it doesn't appear to show method calls between objects..? anyway, I'm not worried about 'pretty' :)
aland
+1  A: 

If you use profiling with xdebug you can get cachegrind files to open up with WinCacheGrind or similar. More info here.

schmilblick
A: 

You should check out nWire. The first nWire for PHP beta was just released. It is an interactive tool which lets you visualize practically every possible association in your code.

zvikico