52 public static function enable( $flags = 0, $options = [] ) {
53 if ( self::isEnabled() ) {
54 throw new Exception(
'Profiling is already enabled.' );
62 self::$enabled =
true;
67 'tideways_xhprof_enable'
79 if ( self::isEnabled() ) {
80 self::$enabled =
false;
84 'tideways_xhprof_disable'
98 protected static function callAny( array $functions, array
$args = [] ) {
99 foreach ( $functions as $func ) {
100 if ( function_exists( $func ) ) {
101 return $func( ...
$args );
105 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 callAny(array $functions, array $args=[])
Call the first available function from $functions.
static isEnabled()
Start xhprof profiler.