35 private static $times = array();
44 private static $timerQueue = array();
52 private static $timerLabels = array();
64 public static function dump(
$var, $inline =
false)
67 $eventName =
'debug.log';
68 if (!$inline && $events->hasListeners($eventName)) {
69 $events->triggerEvent($eventName,
$var);
73 'skin' => array(
'selected' =>
'modern'),
76 'show_version' =>
false,
77 'show_call_info' =>
false,
78 'sort_arrays' =>
false,
98 $eventName =
'debug.log';
99 if (!$inline && $events->hasListeners($eventName)) {
100 $events->triggerEvent($eventName, debug_backtrace());
102 return self::dump(debug_backtrace(), $inline);
119 $eventName =
'debug.timer.start';
120 if ($events->hasListeners($eventName)) {
121 $events->triggerEvent($eventName,
$var);
123 self::$times[
$name] = microtime(
true);
137 $eventName =
'debug.timer.stop';
138 if ($events->hasListeners($eventName)) {
139 $events->triggerEvent($eventName,
$name);
141 echo
$name .
' - ' . intval(microtime(
true) - self::$times[
$name]) .
" \n";
159 self::$times[
$name] = microtime(
true);
160 self::$timerLabels[
$name] = empty($label) ?
$name : $label;
172 if (isset(self::$timerLabels[
$name]) && isset(self::$times[$name])) {
174 'label' => self::$timerLabels[$name],
175 'start' => self::$times[$name],
176 'elapsed' => microtime(
true) - self::$times[$name],
178 self::$timerQueue[] = $queueItem;
194 $queue = self::$timerQueue;
195 self::$timerQueue = array();
216 public static function startTrace($tracefile =
'', $collect_params =
'3', $collect_return =
'On')
218 if (function_exists(
'xdebug_start_trace')) {
219 ini_set(
'xdebug.collect_params', $collect_params);
220 ini_set(
'xdebug.collect_return', $collect_return);
221 if ($tracefile ==
'') {
224 xdebug_start_trace($tracefile);
237 if (function_exists(
'xdebug_stop_trace')) {
static startQueuedTimer($name, $label=null)
static startTrace($tracefile= '', $collect_params= '3', $collect_return= 'On')
static startTimer($name, $label=null)
static backtrace($inline=false)
static dump($var, $inline=false)
if(!is_object($module)||!$module->getVar('isactive')) $msg
static dumpQueuedTimers($returnOnly=false)
static stopQueuedTimer($name)