Просмотр исходного кода

[HttpKernel] fixed profile saving when it has children

Fabien Potencier 13 лет назад
Родитель
Сommit
c0f5b8a3b6
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php

+ 2 - 1
src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php

@@ -89,11 +89,12 @@ class ProfilerListener
 
 
         if ($profile = $this->profiler->collect($event->getRequest(), $event->getResponse(), $exception)) {
         if ($profile = $this->profiler->collect($event->getRequest(), $event->getResponse(), $exception)) {
             if ($master) {
             if ($master) {
-                $this->profiler->saveProfile($profile);
                 foreach ($this->children as $child) {
                 foreach ($this->children as $child) {
                     $child->setParent($profile);
                     $child->setParent($profile);
+                    $profile->addChild($child);
                     $this->profiler->saveProfile($child);
                     $this->profiler->saveProfile($child);
                 }
                 }
+                $this->profiler->saveProfile($profile);
                 $this->children = array();
                 $this->children = array();
             } else {
             } else {
                 $this->children[] = $profile;
                 $this->children[] = $profile;