symfony/symfony — Issue #2515: Profile is stored twice
Author: stof
Created: 2011-10-29 10:47:02+00:00
State: open
Labels: Bug, HttpKernel

Since the latest refctoring of the ProfilerListener, the main profile is saved twice, which leads to logging a warning the second time saying ``Unable to store the profiler information`` as the file already exists.

This can easily be seen by doing this change in the profiler and looking at the logs. The main profile will appear twice.

```patch
diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php
index d66b70f..0a33b3b 100644
--- a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php
+++ b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php
@@ -88,6 +88,7 @@ class Profiler
*/
public function saveProfile(Profile $profile)
{
+ $this->logger->info(sprintf('Saving profile %s', $profile->getToken()));
if (!($ret = $this->storage->write($profile)) && null !== $this->logger) {
$this->logger->warn('Unable to store the profiler information.');
}
```