Skip to content

How it works

Simon Frost edited this page Mar 16, 2019 · 2 revisions

Create the trace file

See the Generating a trace file using Xdebug page.

Load the trace file into Pathfinder

Load the homepage and select a file from the drop down.

The drop-down is populated based on the contents of the xdebug.trace_output_dir setting. Xdebug does not have to be enabled for Pathfinder to process and display trace files. If Xdebug is not enabled, the path /var/www/html/watson/watson-pathfinder/xdebug-trace-files/ is used instead.

Pathfinder parses the trace file

The filepath of the selected trace file is passed to the constructor of the XdebugParser class.

The parse method reads the trace file, one line at a time, and passes the data to the parseLine method, which parses the line according to the Xdebug documentation (https://xdebug.org/docs/all_settings#trace_format). The parsed data is stored in an array.

Pathfinder generates the HTML tree representation of the trace file

When the getTraceHTML method is called, it uses output buffering to generate a HTML tree of the parsed data.