Re: ability to find include files...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




hi t!!

strace is something i would have used.. but unfortunately, strace (at least as far as i can tell) doesn't work with web based apps...

thanks


-----Original Message-----
From: Thodoris [mailto:tgol@xxxxxxxxxx]
Sent: Sunday, November 16, 2008 11:42 PM
To: Andrew Ballard
Cc: bruce; php-general@xxxxxxxxxxxxx
Subject: Re:  ability to find include files...




On Sat, Nov 15, 2008 at 6:07 PM, bruce <bedouglas@xxxxxxxxxxxxx> wrote:
Hi list...

starting to go through a debug/understanding session of a couple of php web
apps. i'm wondering if there's any kind of tool/method that i can use to see
which files are accessed/included/required when a given page is displayed..

this would allow me to quickly understand the "flow" of the apps. searching
via google hasn't really turned up anything...

thoughts/comments/pointers welcome.

thanks!

Yes. How about get_included_files().

http://www.php.net/get_included_files

Andrew

This of course shows the included files but if you *really* need to go much deeper (although this is probably an overkill) you could try tracing when the process opens a file using strace along with grep if you are in unix.



Yes that is true because you can use it only with the cli. But you could probably make a command line (stripped) version of the script just to see what are the files that it opens. But this is truly an overkill. There are better methods to debug this IMO than tracing the scripts behavior.

I would suggest to use var_dump to dump all the vars you need to understand and then use die to end the script wherever you need to stop the execution.

If the project you are trying to understand depends on a framework things become more complicated and you need a better understanding on the framework (I guess).

--
Thodoris


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux