From 2583bc73f2cd3e30239c3a8af1e6ac4747c32100 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Tue, 21 Jan 2014 08:45:25 +0000 Subject: [PATCH] Permet d'activer xhprof --- .gitattributes | 2 ++ bureau/admin/foot.php | 1 + bureau/admin/xhprof_footer.php | 12 ++++++++++++ bureau/admin/xhprof_header.php | 7 +++++++ bureau/class/config.php | 3 +++ 5 files changed, 25 insertions(+) create mode 100644 bureau/admin/xhprof_footer.php create mode 100644 bureau/admin/xhprof_header.php diff --git a/.gitattributes b/.gitattributes index 5803dcf5..3ef24051 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/bureau/admin/foot.php b/bureau/admin/foot.php index 95e579d7..812e41ce 100644 --- a/bureau/admin/foot.php +++ b/bureau/admin/foot.php @@ -10,5 +10,6 @@ if ( isset($debug_alternc) && $debug_alternc->status ) { diff --git a/bureau/admin/xhprof_footer.php b/bureau/admin/xhprof_footer.php new file mode 100644 index 00000000..0fcf6e29 --- /dev/null +++ b/bureau/admin/xhprof_footer.php @@ -0,0 +1,12 @@ +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&source=%s', $run_id, $profiler_namespace); + echo '

Profiler output

'; +} +?> diff --git a/bureau/admin/xhprof_header.php b/bureau/admin/xhprof_header.php new file mode 100644 index 00000000..7406dc32 --- /dev/null +++ b/bureau/admin/xhprof_header.php @@ -0,0 +1,7 @@ + diff --git a/bureau/class/config.php b/bureau/class/config.php index 0d4d2bfc..400eef21 100644 --- a/bureau/class/config.php +++ b/bureau/class/config.php @@ -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')) {