Web lists-archives.com

Re: [PHP] Caller/called graph




I use this:


function DebugBackTraceHtml()

// Returns an HTML string with calls and subcalls until the current execution.

{

    $HtmlValue = '';

    $HtmlValue = $HtmlValue.'<p>DEBUG backtrace:</p>'."\n";

    $StepNr = 1;

    while (isset(debug_backtrace()[$StepNr])) {

        $HtmlValue = $HtmlValue.'<p>['.$StepNr.'] File '.debug_backtrace()[$StepNr]['file'].' at line '.debug_backtrace()[$StepNr]['line'].' executing: <strong>'.debug_backtrace()[$StepNr]['function'].'</strong></p>'."\n";

        $StepNr = $StepNr + 1;

    }

    return $HtmlValue;

}





El 29/09/16 a les 05:32, Sam Hobbs ha escrit:
> If I am using an editor such as Eclipse to analyze a large PHP system
> and I want to find the file that a function is declared in then I can
> search for it. I think that the (right-click) context menu for the
> function sometimes has an item to open the declaration but that does
> not always work. The same for an include statement; even if I don't
> know what the path will be during execution and even if the source is
> in multiple folders, I can search for the file. For large systems
> however all that can take time (my time).
>
> Is there a tool that can process thousands (at least a couple
> thousand) files and produce data of what file that a called function
> exists in and where a function is called from? In other words,
> caller/called data. I understand the technical challenges. In PHP
> includes are processed during execution so I know it might not be
> possible but I am asking if there is anything that can do it as much
> as possible.
>
> I searched the mailing list for "caller called" and found nothing, I
> apologize if this has been asked before.
>
>


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