Skip to content
This repository has been archived by the owner on Sep 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #4 from tommyseus/tideways_xhprof
Browse files Browse the repository at this point in the history
Support for tideways_xhprof
  • Loading branch information
markstory authored Jan 12, 2018
2 parents 81e4ab8 + 4579733 commit 8fadfe3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions external/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
*/

// this file should not - under no circumstances - interfere with any other application
if (!extension_loaded('xhprof') && !extension_loaded('uprofiler') && !extension_loaded('tideways')) {
error_log('xhgui - either extension xhprof, uprofiler or tideways must be loaded');
if (!extension_loaded('xhprof')
&& !extension_loaded('uprofiler')
&& !extension_loaded('tideways')
&& !extension_loaded('tideways_xhprof')
) {
error_log('xhgui - either extension xhprof, uprofiler, tideways or tideways_xhprof must be loaded');
return;
}

Expand Down Expand Up @@ -93,6 +97,8 @@
uprofiler_enable(UPROFILER_FLAGS_CPU | UPROFILER_FLAGS_MEMORY, $options);
} else if (extension_loaded('tideways')) {
tideways_enable(TIDEWAYS_FLAGS_CPU | TIDEWAYS_FLAGS_MEMORY | TIDEWAYS_FLAGS_NO_SPANS, $options);
} elseif (extension_loaded('tideways_xhprof')) {
tideways_xhprof_enable(TIDEWAYS_XHPROF_FLAGS_CPU | TIDEWAYS_XHPROF_FLAGS_MEMORY);
} else {
if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 4) {
xhprof_enable(XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY | XHPROF_FLAGS_NO_BUILTINS, $options);
Expand All @@ -107,6 +113,8 @@ function () {
$data['profile'] = uprofiler_disable();
} else if (extension_loaded('tideways')) {
$data['profile'] = tideways_disable();
} elseif (extension_loaded('tideways_xhprof')) {
$data['profile'] = tideways_xhprof_disable();
} else {
$data['profile'] = xhprof_disable();
}
Expand Down

0 comments on commit 8fadfe3

Please sign in to comment.