From 14db706c96fa1d405a86730361f2571d3be1b489 Mon Sep 17 00:00:00 2001 From: Dimosthenis Nikoudis Date: Fri, 3 Aug 2018 05:20:55 +0300 Subject: [PATCH 1/2] Reset doctrine object manager if closed --- Bootstraps/Symfony.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bootstraps/Symfony.php b/Bootstraps/Symfony.php index 0a742a7..c9a9d76 100644 --- a/Bootstraps/Symfony.php +++ b/Bootstraps/Symfony.php @@ -111,6 +111,13 @@ public function postHandle($app) { $container = $app->getContainer(); + if ($container->has('debug.stopwatch')) { + $em = $container->get("doctrine"); + if (!$em->getManager()->isOpen()) { + $em->resetManager(); + } + } + //resets stopwatch, so it can correctly calculate the execution time if ($container->has('debug.stopwatch')) { $container->get('debug.stopwatch')->__construct(); From 92309dbe7c16585851f46e02b41f896f12fa628f Mon Sep 17 00:00:00 2001 From: Dimosthenis Nikoudis Date: Fri, 3 Aug 2018 05:26:35 +0300 Subject: [PATCH 2/2] Fix wrong condition --- Bootstraps/Symfony.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bootstraps/Symfony.php b/Bootstraps/Symfony.php index c9a9d76..09b49e2 100644 --- a/Bootstraps/Symfony.php +++ b/Bootstraps/Symfony.php @@ -111,7 +111,7 @@ public function postHandle($app) { $container = $app->getContainer(); - if ($container->has('debug.stopwatch')) { + if ($container->has('doctrine')) { $em = $container->get("doctrine"); if (!$em->getManager()->isOpen()) { $em->resetManager();