Permet d'activer xhprof

This commit is contained in:
Alan Garcia 2014-01-21 08:45:25 +00:00
parent ca692da0f7
commit 2583bc73f2
5 changed files with 25 additions and 0 deletions

2
.gitattributes vendored
View File

@ -388,6 +388,8 @@ bureau/admin/styles/style.css -text
bureau/admin/tempovars.php -text
bureau/admin/vm.php -text
bureau/admin/webmail-redirect.php -text
bureau/admin/xhprof_footer.php -text
bureau/admin/xhprof_header.php -text
bureau/class/config.php -text
bureau/class/config_nochk.php -text
bureau/class/db_mysql.php -text

View File

@ -10,5 +10,6 @@ if ( isset($debug_alternc) && $debug_alternc->status ) {
</body>
</html>
<?php
require_once("xhprof_footer.php");
exit(); // case of include('foot.php');
?>

View File

@ -0,0 +1,12 @@
<?php
if ( (extension_loaded('xhprof')) && DO_XHPROF_STATS ) {
$profiler_namespace = 'alternc'; // namespace for your application
$xhprof_data = xhprof_disable();
$xhprof_runs = new XHProfRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, $profiler_namespace);
// url to the XHProf UI libraries (change the host name and path)
$profiler_url = sprintf('/xhprof/xhprof_html/index.php?run=%s&amp;source=%s', $run_id, $profiler_namespace);
echo '<p><h3><a href="'. $profiler_url .'" target="_blank">Profiler output</a></h3></p>';
}
?>

View File

@ -0,0 +1,7 @@
<?php
if ( (extension_loaded('xhprof')) && DO_XHPROF_STATS ) {
include_once '/usr/share/php/xhprof_lib/utils/xhprof_lib.php';
include_once '/usr/share/php/xhprof_lib/utils/xhprof_runs.php';
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
}
?>

View File

@ -28,6 +28,9 @@
----------------------------------------------------------------------
*/
define('DO_XHPROF_STATS', FALSE);
require_once('xhprof_header.php');
// To enable the display of the alternc debug error, do the following :
// # touch /etc/alternc/alternc_display_php_error
if (file_exists('/etc/alternc/alternc_display_php_error')) {