Re: Caller/called graph
| From: | Narcis Garcia | Date: | Thu, 29 Sep 2016 07:31:55 +0000 |
| Subject: | Re: Caller/called graph | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325756@lists.php.net to get a copy of this message | ||
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.
>
>