In web programming, I am relatively recent, but I think I already know enough, but recently there was a serious problem. The essence is this: they give me a task for any site, respectively, I need to know how this script works, which classes and where in the file system are used, but all my projects (like most now) are full-featured object-oriented systems and the structure of the script consists of a set of connections from different libraries, I can not properly understand the principle of connection and use of a particular class. What programs or php libraries can be that allow you to get a complete trace of classes and functions, i.e. when I called in any script, I received full information, where classes are connected from, what functions and methods are used.

    2 answers 2

    Debugging

    • Zend Debugger from Zend Studio
    • Xdebug extension for PHP
    • Work with code ( debug_backtrace , debug_print_backtrace , var_dump )

    -

      var_dump(debug_backtrace()); 

    Testing

    • PhpUnit - unit testing framework
    • xDebug already starting to learn, from what I read, I realized that I needed to trace my script, in this regard, do not tell me what is a good visualizer for trace logs for ubuntu, I tried KCachegrind, but it seems to be for profiling more. - w00lf
    • Note the [trace file parser] [1] or [trace gui] [2], as well as [Xdebug Profiling Web Frontend in PHP] [3]. [1]: rdlt.com/xdebug-trace-file-parser.html [2]: github.com/corretge/xdebug-trace-gui [3]: github.com/jokkedk/webgrind - stanislav
    • Many thanks for the program, this is what you need. - w00lf

    Um ... with eyes and handles + search :) That's all :) And in catching up - there is a magic function var_dump, which will show the structure of any type of object.

    Also, you can see the results on "code profiling" in Google. This is something like debugger.

    • I tried to do that, the time efficiency is very low, and the boss demands results, that's why I want to know how to automate it. - w00lf
    • Then you do not have enough experience :) Hmm, and what, there is no documentation to the code? No comments too? Nothing, nothing? :))) - Stanislav Komar