D
D
DileSoft2011-04-19 12:52:05
PHP
DileSoft, 2011-04-19 12:52:05

Is it possible to get a list of all include files in PHP?

That is, the index.php script is executed, calls other scripts, those third ones, etc. As a result, I want to get a complete list of called files, ideally with line numbers of the call.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
K
kirsan_vlz, 2011-04-19
@kirsan_vlz

php.net/manual/en/function.get-included-files.php

Z
zizop, 2011-04-19
@zizop

If you get too confused, you can do it like this:
1. Connect runkit .
2. Redefine the include functions: include(), include_once(), require(), require_once() with our own, which will be wrappers for the original ones.
3. In the wrapper, through debug_backtrace(), we find out who called the function, and collect the calls in the log.

L
lashtal, 2011-04-19
@lashtal

xdebug :
xdebug_start_code_coverage()… xdebug_get_code_coverage()
- returns all included files and executed line numbers.

A
Alexey Shein, 2011-04-20
@conf

If you are profiling, then I recommend this article: css.dzone.com/news/profiling-php-application
Xhgui over xhprof is especially good.

P
Puma Thailand, 2011-04-21
@opium

xdebug
zend debug

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question