Avoid load xhprof result for AJAX requests

pull/2487/head
Angel Fernando Quiroz Campos 8 years ago
parent 4a8274a660
commit 3976787593
  1. 5
      tests/xhprof/footer.php
  2. 5
      tests/xhprof/header.php

@ -5,7 +5,10 @@
/**
* Init
*/
if (extension_loaded('tideways')) {
$isAjaxRequest = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
if (extension_loaded('tideways') && !$isAjaxRequest) {
$profiler_namespace = 'chamilolms'; // namespace for your application
$xhprof_data = tideways_disable();
//$xhprof_runs = new XHProfRuns_Default();

@ -11,7 +11,10 @@
* in your php config also disable the .htaccess line about the tests/
* directory.
*/
if (extension_loaded('tideways')) {
$isAjaxRequest = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest';
if (extension_loaded('tideways') && !$isAjaxRequest) {
//include_once __DIR__.'/xhprof_lib/utils/xhprof_lib.php';
//include_once __DIR__.'/xhprof_lib/utils/xhprof_runs.php';
tideways_enable(TIDEWAYS_FLAGS_NO_SPANS);

Loading…
Cancel
Save