50 public static function enable( $flags = 0, $options = [] ) {
51 if ( self::isEnabled() ) {
52 throw new Exception(
'Profiling is already enabled.' );
64 'tideways_xhprof_enable'
68 self::$enabled =
true;
77 if ( self::isEnabled() ) {
78 self::$enabled =
false;
82 'tideways_xhprof_disable'
96 protected static function callAny( array $functions, array
$args = [] ) {
97 foreach ( $functions as $func ) {
98 if ( function_exists( $func ) ) {
99 return $func( ...
$args );
103 throw new Exception(
"Neither xhprof nor tideways are installed" );
Convenience class for working with XHProf https://github.com/phacility/xhprof.
static enable( $flags=0, $options=[])
Start xhprof profiler.
static disable()
Stop xhprof profiler.
static bool $enabled
Whether XHProf is currently running.
static callAny(array $functions, array $args=[])
Call the first available function from $functions.
static isEnabled()
Start xhprof profiler.