@@ -114,6 +114,9 @@ class Debugger
114114 /** @var ILogger */
115115 private static $ fireLogger ;
116116
117+ /** @var Session */
118+ private static $ session ;
119+
117120
118121 /**
119122 * Static class - cannot be instantiated.
@@ -180,6 +183,10 @@ public static function enable($mode = NULL, $logDirectory = NULL, $email = NULL)
180183
181184 array_map ('class_exists ' , ['Tracy\Bar ' , 'Tracy\BlueScreen ' , 'Tracy\DefaultBarPanel ' , 'Tracy\Dumper ' ,
182185 'Tracy\FireLogger ' , 'Tracy\Helpers ' , 'Tracy\Logger ' ]);
186+
187+ if (!self ::$ productionMode ) {
188+ self ::getSession ()->open (session_save_path () ?: ini_get ('upload_tmp_dir ' ) ?: self ::$ logDirectory );
189+ }
183190 }
184191
185192
@@ -415,7 +422,7 @@ public static function getBlueScreen()
415422 public static function getBar ()
416423 {
417424 if (!self ::$ bar ) {
418- self ::$ bar = new Bar ;
425+ self ::$ bar = new Bar ( self :: getSession ()) ;
419426 self ::$ bar ->addPanel ($ info = new DefaultBarPanel ('info ' ), 'Tracy:info ' );
420427 $ info ->cpuUsage = self ::$ cpuUsage ;
421428 self ::$ bar ->addPanel (new DefaultBarPanel ('errors ' ), 'Tracy:errors ' ); // filled by errorHandler()
@@ -459,6 +466,19 @@ public static function getFireLogger()
459466 }
460467
461468
469+ /**
470+ * @return Session
471+ * @internal
472+ */
473+ public static function getSession ()
474+ {
475+ if (!self ::$ session ) {
476+ self ::$ session = new Session ;
477+ }
478+ return self ::$ session ;
479+ }
480+
481+
462482 /********************* useful tools ****************d*g**/
463483
464484
0 commit comments