|
@@ -10,22 +10,23 @@ register_shutdown_function(
|
|
|
file_put_contents('/code/' . $name,
|
|
file_put_contents('/code/' . $name,
|
|
|
serialize($data));
|
|
serialize($data));
|
|
|
|
|
|
|
|
- include_once "/utils/callgraph_utils.php";
|
|
|
|
|
- include_once "/utils/xhprof_lib.php";
|
|
|
|
|
- include_once "/utils/xhprof_runs.php";
|
|
|
|
|
|
|
+ if (getenv('SVG')) {
|
|
|
|
|
+ include_once "/utils/callgraph_utils.php";
|
|
|
|
|
+ include_once "/utils/xhprof_lib.php";
|
|
|
|
|
+ include_once "/utils/xhprof_runs.php";
|
|
|
|
|
|
|
|
- echo "Generating dot script\n";
|
|
|
|
|
- $threshold = 0;
|
|
|
|
|
- if (count($data) > 1000) {
|
|
|
|
|
- $threshold = 0.001;
|
|
|
|
|
|
|
+ echo "Generating dot script\n";
|
|
|
|
|
+ $threshold = 0;
|
|
|
|
|
+ if (count($data) > 1000) {
|
|
|
|
|
+ $threshold = 0.001;
|
|
|
|
|
+ }
|
|
|
|
|
+ $script = xhprof_generate_dot_script($data, $threshold, null, null, null, null);
|
|
|
|
|
+ echo "Generating dot image\n";
|
|
|
|
|
+ $content = xhprof_generate_image_by_dot($script, 'svg');
|
|
|
|
|
+ echo 'Saving graph to ' . $name . '.svg', "\n";
|
|
|
|
|
+ file_put_contents('/code/' . $name . '.svg',
|
|
|
|
|
+ $content);
|
|
|
}
|
|
}
|
|
|
- $script = xhprof_generate_dot_script($data, $threshold, null, null, null, null);
|
|
|
|
|
- echo "Generating dot image\n";
|
|
|
|
|
- $content = xhprof_generate_image_by_dot($script, 'svg');
|
|
|
|
|
- echo 'Saving graph to ' . $name . '.svg', "\n";
|
|
|
|
|
- file_put_contents('/code/' . $name . '.svg',
|
|
|
|
|
- $content);
|
|
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|