Skip to content

Commit

Permalink
fix ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Polischuk committed Mar 16, 2015
1 parent f3eb777 commit f5f7f70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion external/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
define('XHPROF_LIB_ROOT', dirname(dirname(__FILE__)) . '/xhprof_lib');
}

if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
$isAjax = true;
}

if (extension_loaded('xhprof') && $_xhprof['doprofile'] === true) {
$profiler_namespace = $_xhprof['namespace']; // namespace for your application
$xhprof_data = xhprof_disable();
$xhprof_runs = new XHProfRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, $profiler_namespace, null, $_xhprof);
if ($_xhprof['display'] === true && PHP_SAPI != 'cli')
if ($_xhprof['display'] === true && PHP_SAPI != 'cli' && isset($isAjax))
{
// url to the XHProf UI libraries (change the host name and path)
$profiler_url = sprintf($_xhprof['url'].'/index.php?run=%s&source=%s', $run_id, $profiler_namespace);
Expand Down

0 comments on commit f5f7f70

Please sign in to comment.