@@ -114,6 +114,9 @@ class Debugger
114
114
/** @var ILogger */
115
115
private static $ fireLogger ;
116
116
117
+ /** @var Session */
118
+ private static $ session ;
119
+
117
120
118
121
/**
119
122
* Static class - cannot be instantiated.
@@ -180,6 +183,10 @@ public static function enable($mode = NULL, $logDirectory = NULL, $email = NULL)
180
183
181
184
array_map ('class_exists ' , ['Tracy\Bar ' , 'Tracy\BlueScreen ' , 'Tracy\DefaultBarPanel ' , 'Tracy\Dumper ' ,
182
185
'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
+ }
183
190
}
184
191
185
192
@@ -415,7 +422,7 @@ public static function getBlueScreen()
415
422
public static function getBar ()
416
423
{
417
424
if (!self ::$ bar ) {
418
- self ::$ bar = new Bar ;
425
+ self ::$ bar = new Bar ( self :: getSession ()) ;
419
426
self ::$ bar ->addPanel ($ info = new DefaultBarPanel ('info ' ), 'Tracy:info ' );
420
427
$ info ->cpuUsage = self ::$ cpuUsage ;
421
428
self ::$ bar ->addPanel (new DefaultBarPanel ('errors ' ), 'Tracy:errors ' ); // filled by errorHandler()
@@ -459,6 +466,19 @@ public static function getFireLogger()
459
466
}
460
467
461
468
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
+
462
482
/********************* useful tools ****************d*g**/
463
483
464
484
0 commit comments