Skip to content

Commit

Permalink
render class and method on separate lines to make graph less wide. ad…
Browse files Browse the repository at this point in the history
…justed table styles.
  • Loading branch information
staabm committed Dec 30, 2013
1 parent 08020c7 commit 624149e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions xhprof/classes/callgraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,24 @@ public function dot($callstack, $output = FALSE, $debug = FALSE)
if(!empty($e['group']) && $e['group']['index'] < 10) {
$column_group_color = ' bgcolor="' . $group_colors[$e['group']['index']-1] . '"';
}

$class = '';
$method = $e['callee'];
if(($pos = strpos($e['callee'], '::')) !== false) {
$class = trim(substr($e['callee'], 0, $pos));
$method = substr($e['callee'], $pos + 2);

// when using eval, callee also contains the filename.
// cut it off, to save space
if(($pos = strpos($method, ':')) !== false) {
$method = trim(substr($method, $pos + 1));
}
}

$players[$callee_uid] = "\t\"" . $callee_uid . '"[shape=none, label=<
<table border="0" cellspacing="0" cellborder="1" cellpadding="5">
$players[$callee_uid] = "\t\"" . $callee_uid . '"[shape=none,label=<
<table border="0" cellspacing="0" cellborder="1" cellpadding="2" CELLSPACING="0">
<tr>
<td colspan="2" align="left"' . $column_group_color . '>' . $e['callee'] . '</td>
<td colspan="2" align="left"' . $column_group_color . '>' . $class . '<br />' . $method . '</td>
</tr>
' . $ct . '
<tr>
Expand Down Expand Up @@ -133,7 +146,6 @@ public function graph($dot_script)

header('Content-Type: image/svg+xml');
#header('Content-Type: image/png');

echo $output;

exit;
Expand Down

0 comments on commit 624149e

Please sign in to comment.