function xh_flags

master xh.drush.inc xh_flags()

Determines flags for xhprof_enable based on drush options.

2 calls to xh_flags()
xhUnitCase::testFlags in tests/xhUnitTest.php
Test various combinations of XHProf flag options.
xh_drush_init in commands/xh.drush.inc
Implements hook_drush_init().

File

commands/xh.drush.inc, line 49

Code

function xh_flags() {
  $flags = 0;
  if (!drush_get_option('xh-profile-builtins', XH_PROFILE_BUILTINS)) {
    $flags |= XHPROF_FLAGS_NO_BUILTINS;
  }
  if (drush_get_option('xh-profile-cpu', XH_PROFILE_CPU)) {
    $flags |= XHPROF_FLAGS_CPU;
  }
  if (drush_get_option('xh-profile-memory', XH_PROFILE_MEMORY)) {
    $flags |= XHPROF_FLAGS_MEMORY;
  }
  return $flags;
}