Skip to content

Instantly share code, notes, and snippets.

@wilr
Created August 6, 2012 06:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wilr/3271377 to your computer and use it in GitHub Desktop.
Save wilr/3271377 to your computer and use it in GitHub Desktop.
XHProf
php_value auto_prepend_file header.php
php_value auto_append_file footer.php
<?php
if (extension_loaded('xhprof')) {
if(isset($_REQUEST['xhprof'])) {
include_once '/opt/local/www/php5-xhprof/xhprof_lib/utils/xhprof_lib.php';
include_once '/opt/local/www/php5-xhprof/xhprof_lib/utils/xhprof_runs.php';
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment