File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/Symfony/Component/HttpKernel/EventListener Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \HttpKernel \EventListener ;
13
13
14
14
use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
15
+ use Symfony \Component \HttpFoundation \Request ;
15
16
use Symfony \Component \HttpFoundation \RequestMatcherInterface ;
16
17
use Symfony \Component \HttpFoundation \RequestStack ;
18
+ use Symfony \Component \HttpFoundation \Session \Session ;
17
19
use Symfony \Component \HttpKernel \Event \FilterResponseEvent ;
18
20
use Symfony \Component \HttpKernel \Event \GetResponseForExceptionEvent ;
19
21
use Symfony \Component \HttpKernel \Event \PostResponseEvent ;
@@ -87,8 +89,21 @@ public function onKernelResponse(FilterResponseEvent $event)
87
89
return ;
88
90
}
89
91
90
- if (!$ profile = $ this ->profiler ->collect ($ request , $ event ->getResponse (), $ exception )) {
91
- return ;
92
+ $ session = method_exists (Request::class, 'getPreferredFormat ' ) && $ request ->hasPreviousSession () && $ request ->hasSession () ? $ request ->getSession () : null ;
93
+
94
+ if ($ session instanceof Session) {
95
+ $ usageIndexValue = $ usageIndexReference = &$ session ->getUsageIndex ();
96
+ $ usageIndexReference = \PHP_INT_MIN ;
97
+ }
98
+
99
+ try {
100
+ if (!$ profile = $ this ->profiler ->collect ($ request , $ event ->getResponse (), $ exception )) {
101
+ return ;
102
+ }
103
+ } finally {
104
+ if ($ session instanceof Session) {
105
+ $ usageIndexReference = $ usageIndexValue ;
106
+ }
92
107
}
93
108
94
109
$ this ->profiles [$ request ] = $ profile ;
You can’t perform that action at this time.
0 commit comments