footer.php 656 B

1234567891011121314151617
  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. $subDir = substr(__DIR__, strlen(trim($_SERVER['DOCUMENT_ROOT'])));
  15. $profiler_url = sprintf($subDir.'/xhprof_html/index.php?run=%s&source=%s', $run_id, $profiler_namespace);
  16. echo '<a href="'. $profiler_url .'" target="_blank">Profiler output</a>';
  17. }