Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Bootstraps/Symfony.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use PHPPM\Utils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Contracts\Service\ResetInterface;
use function PHPPM\register_file;

/**
Expand Down Expand Up @@ -167,11 +168,13 @@ public function postHandle($app)

if ($container->has('doctrine')) {
$doctrineRegistry = $container->get("doctrine");
foreach ($doctrineRegistry->getManagers() as $curManagerName => $curManager) {
if (!$curManager->isOpen()) {
$doctrineRegistry->resetManager($curManagerName);
} else {
$curManager->clear();
if (!$doctrineRegistry instanceof ResetInterface) {
foreach ($doctrineRegistry->getManagers() as $curManagerName => $curManager) {
if (!$curManager->isOpen()) {
$doctrineRegistry->resetManager($curManagerName);
} else {
$curManager->clear();
}
}
}
}
Expand All @@ -198,7 +201,7 @@ public function postHandle($app)
$container->privates['webpack_encore.entrypoint_lookup']->reset();
}
}, $container);

//reset all profiler stuff currently supported
if ($container->has('profiler')) {
$profiler = $container->get('profiler');
Expand Down