Answer the question
In order to leave comments, you need to log in
Are there ready-made solutions for building a dependency tree between files?
I would like to get (json, ini, associative array, xml - whatever) file inclusion tree (something like this ).
The problem can be solved in three ways:
zend_extension_ts="D:\PHP\ext\php_xdebug.dll"
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "D:\server\profiling\"
xdebug.trace_output_name = %t.%s.%H
xdebug.collect_params 1
xdebug.collect_return 1
xdebug.collect_vars 1
xdebug.default_enable 1
xdebug.show_mem_delta 1
php_flag xdebug.auto_trace 1
xdebug.trace_format 1
Answer the question
In order to leave comments, you need to log in
> Xdebug would be a great option, but none of the utility that works with its output file contains the functionality of spying on inclusions
So I suggest to implement it yourself, especially since the format is very simple and it seems that all logic will be reduced to tracking "fn=require_once::. .." (cfn)
Example:
fl=ips_kernel/classDbMysql.php
fn=require_once::ips_kernel/classDbMysql.php
1 91512
cfn=php::define
calls=1 0 0
25 4
cfn=php::class_exists
calls=1 0 0
30 5
cfn=php::dirname
calls=1 0 0
32 1
cfn=require_once::ips_kernel/classDb.php
calls=1 0 0
32 36
cfn=php::extension_loaded
calls=1 0 0
1066 1
cfn=php::defined
calls=1 0 0
1066 5
cfn=php::dirname
calls=1 0 0
1068 1
cfn=require::ips_kernel/classDbMysqliClient.php
calls=1 0 0
1068 79
ips_kernel/classDbMysql.php
-> ips_kernel/classDb.php
-> ips_kernel/classDbMysqliClient.php
5) Use the xdebug output file - it has all the information and parsing it, in my opinion, is easier (http://kcachegrind.sourceforge.net/html/CallgrindFormat.html).
Is there no way to peep in the interpreter code what the include does? Perhaps there is already a solution
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question