Fully expanded PHP source code file

Does anyone know of an existing tool or code snippet that, given a PHP source code file, replaces the include(), include_once(), require(), require_once() single line entries appropriately with the actual text of those files so that you could see (and run) in a single file the complete code including all functions definitions for a page?

I’m looking at a reasonably large PHP application at the moment & its very difficult & time-consuming to read through the code when significant pieces of code, variable and function definitions are buried in a number of different files in a number of different locations throughout the file system.

It would be nice if it also handled nested includes and pretty-printed the code like the PHP functions show_source() & highlight_file() do!

Thanks in advance,
John

Just get a php ide. I don’t think any of them expand things into a single file for you, but that would suck anyway. You can do cool stuff like right click on a function name and have it navigate you to the function declaration, opening the file and going to the line. A lot of other helpful stuff. Read their docs, it’s time well invested.

I’ve been pretty happy with netbeans(it can do php pretty well), but I’m sure most of the others offer similar functionality.

edit for lol- thier website is dumping database errors right now :smiley:

I know what you mean about following code. I’ve been trying to track down the cause of some unserialize() errors in WordPress for a while. As complicated as OOP can be, I’m not sure seeing everything consolidated into one big file would be much easier. That said, you could take a look at the Eclipse IDE too, although IMHO Netbeans has matured a lot since when I used it to play with Java a while back and probably is comparable to Eclipse by now.

I never thought of using it for PHP for some reason. Hmmmm, maybe I can get a plugin for it (4.0 my d*** Win 98 OS!)?

That’s great - thanks guys!
Netbeans it is then … a voyage of discovery!
Cheers,
John