footer.php 742 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * @package chamilo.profiling
  4. */
  5. /**
  6. * Init
  7. */
  8. if (extension_loaded('xhprof')) {
  9. $profiler_namespace = 'chamilolms'; // namespace for your application
  10. $xhprof_data = xhprof_disable();
  11. $xhprof_runs = new XHProfRuns_Default();
  12. $run_id = $xhprof_runs->save_run($xhprof_data, $profiler_namespace);
  13. // url to the XHProf UI libraries (change the host name and path)
  14. $url = api_get_path(WEB_PATH);
  15. $profiler_url = sprintf($url.'tests/xhprof/xhprof_html/index.php?run=%s&source=%s', $run_id, $profiler_namespace);
  16. $xhprof = '<br /><a class="btn btn-primary" href="'. $profiler_url .'" target="_blank">xhprof profiler output</a><br /><br />';
  17. echo $xhprof;
  18. error_log("xhprof runid: $run_id");
  19. }