Skip to content

Commit 0126a35

Browse files
Merge branch '4.4' into 5.4
* 4.4: [PropertyInfo] CS fix [Serializer] Try all possible denormalization route with union types when ALLOW_EXTRA_ATTRIBUTES=false CS fix [Cache] Respect $save option in ChainAdapter [ExpressionLanguage] fix tests (bis) [ExpressionLanguage] fix tests [Cache] Respect $save option in ArrayAdapter [HttpKernel] Disable session tracking while collecting profiler data [MonologBridge] Fixed support of elasticsearch 7.+ in ElasticsearchLogstashHandler [DoctrineBridge] Extend type guessing on enum fields Fix for missing sender name in case with usage of the EnvelopeListener
2 parents b113a72 + 0939810 commit 0126a35

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

DataCollector/MemoryDataCollector.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,8 @@ private function convertToBytes(string $memoryLimit)
100100

101101
switch (substr($memoryLimit, -1)) {
102102
case 't': $max *= 1024;
103-
// no break
104103
case 'g': $max *= 1024;
105-
// no break
106104
case 'm': $max *= 1024;
107-
// no break
108105
case 'k': $max *= 1024;
109106
}
110107

EventListener/ProfilerListener.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
1717
use Symfony\Component\HttpFoundation\RequestStack;
18+
use Symfony\Component\HttpFoundation\Session\Session;
1819
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
1920
use Symfony\Component\HttpKernel\Event\ResponseEvent;
2021
use Symfony\Component\HttpKernel\Event\TerminateEvent;
@@ -96,8 +97,21 @@ public function onKernelResponse(ResponseEvent $event)
9697
return;
9798
}
9899

99-
if (!$profile = $this->profiler->collect($request, $event->getResponse(), $exception)) {
100-
return;
100+
$session = $request->hasPreviousSession() && $request->hasSession() ? $request->getSession() : null;
101+
102+
if ($session instanceof Session) {
103+
$usageIndexValue = $usageIndexReference = &$session->getUsageIndex();
104+
$usageIndexReference = \PHP_INT_MIN;
105+
}
106+
107+
try {
108+
if (!$profile = $this->profiler->collect($request, $event->getResponse(), $exception)) {
109+
return;
110+
}
111+
} finally {
112+
if ($session instanceof Session) {
113+
$usageIndexReference = $usageIndexValue;
114+
}
101115
}
102116

103117
$this->profiles[$request] = $profile;

0 commit comments

Comments
 (0)