Skip to content

Commit

Permalink
Debugger::enable() improved double execution
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 3, 2024
1 parent 9e22a4f commit af0c6bf
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/Tracy/Debugger/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,14 @@ public static function enable(
: !self::detectDebugMode($mode);
}

self::$reserved = str_repeat('t', self::$reservedMemorySize);
self::$time = $_SERVER['REQUEST_TIME_FLOAT'] ?? microtime(true);
self::$obLevel = ob_get_level();
self::$cpuUsage = !self::$productionMode && function_exists('getrusage') ? getrusage() : null;
self::$reserved ??= str_repeat('t', self::$reservedMemorySize);
self::$time ??= $_SERVER['REQUEST_TIME_FLOAT'] ?? microtime(true);
self::$obLevel ??= ob_get_level();
self::$cpuUsage ??= !self::$productionMode && function_exists('getrusage') ? getrusage() : null;

// logging configuration
if ($email !== null) {
self::$email = $email;
}

if ($logDirectory !== null) {
self::$logDirectory = $logDirectory;
}
self::$email = $email ?? self::$email;
self::$logDirectory = $logDirectory ?? self::$logDirectory;

if (self::$logDirectory) {
if (!preg_match('#([a-z]+:)?[/\\\\]#Ai', self::$logDirectory)) {
Expand Down

0 comments on commit af0c6bf

Please sign in to comment.