Skip to content

Commit 0ac4bb1

Browse files
committed
remove doctrine.orm.listeners.pdo_session_handler_schema_listener
workaround symfony/symfony#50322
1 parent e51bbc5 commit 0ac4bb1

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

src/Autocomplete/tests/Fixtures/Kernel.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use Symfony\Bundle\MakerBundle\MakerBundle;
1919
use Symfony\Bundle\SecurityBundle\SecurityBundle;
2020
use Symfony\Bundle\TwigBundle\TwigBundle;
21+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
22+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
23+
use Symfony\Component\DependencyInjection\ContainerBuilder;
2124
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2225
use Symfony\Component\DependencyInjection\Reference;
2326
use Symfony\Component\Form\FormFactoryInterface;
@@ -66,6 +69,17 @@ public function registerBundles(): iterable
6669
yield new ZenstruckFoundryBundle();
6770
}
6871

72+
protected function build(ContainerBuilder $container): void
73+
{
74+
// workaround https://github.com/symfony/symfony/igssues/50322
75+
$container->addCompilerPass(new class() implements CompilerPassInterface {
76+
public function process(ContainerBuilder $container): void
77+
{
78+
$container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener');
79+
}
80+
}, PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
81+
}
82+
6983
protected function configureContainer(ContainerConfigurator $c): void
7084
{
7185
$c->extension('framework', [

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1717
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
1818
use Symfony\Bundle\TwigBundle\TwigBundle;
19+
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
20+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
21+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1922
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2023
use Symfony\Component\HttpFoundation\Response;
2124
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
@@ -26,6 +29,7 @@
2629
use Symfony\UX\TwigComponent\TwigComponentBundle;
2730
use Twig\Environment;
2831
use Zenstruck\Foundry\ZenstruckFoundryBundle;
32+
2933
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
3034

3135
/**
@@ -57,6 +61,17 @@ public function registerBundles(): iterable
5761
yield new ZenstruckFoundryBundle();
5862
}
5963

64+
protected function build(ContainerBuilder $container): void
65+
{
66+
// workaround https://github.com/symfony/symfony/issues/50322
67+
$container->addCompilerPass(new class() implements CompilerPassInterface {
68+
public function process(ContainerBuilder $container): void
69+
{
70+
$container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener');
71+
}
72+
}, PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
73+
}
74+
6075
protected function configureContainer(ContainerConfigurator $c): void
6176
{
6277
$c->extension('framework', [
@@ -106,16 +121,15 @@ protected function configureContainer(ContainerConfigurator $c): void
106121

107122
$c->services()
108123
->defaults()
109-
->autowire()
110-
->autoconfigure()
124+
->autowire()
125+
->autoconfigure()
111126
// disable logging errors to the console
112127
->set('logger', NullLogger::class)
113128
->set(MoneyNormalizer::class)->autoconfigure()->autowire()
114129
->set(Entity2Normalizer::class)->autoconfigure()->autowire()
115130
->load(__NAMESPACE__.'\\Component\\', __DIR__.'/Component')
116131
->set(TestingDeterministicIdTwigExtension::class)
117-
->args([service('ux.live_component.deterministic_id_calculator')])
118-
;
132+
->args([service('ux.live_component.deterministic_id_calculator')]);
119133
}
120134

121135
protected function configureRoutes(RoutingConfigurator $routes): void

0 commit comments

Comments
 (0)