Skip to content

Commit 50109a1

Browse files
committed
Make the legacy kernel a dedicated service, avoid creating services at compile-time
1 parent 6ecb1c1 commit 50109a1

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

DependencyInjection/WebfactoryLegacyIntegrationExtension.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,5 @@ public function load(array $configs, ContainerBuilder $container)
3535
$container->setParameter('webfactory_legacy_integration.parser_class', 'Webfactory\Dom\XHTML10ParsingHelper');
3636
break;
3737
}
38-
39-
if (isset($config['legacyApplicationBootstrapFile'])) {
40-
41-
$wrap = new Definition(
42-
'Webfactory\Bundle\LegacyIntegrationBundle\Integration\BootstrapFileKernelAdaptor',
43-
array($config['legacyApplicationBootstrapFile'])
44-
);
45-
46-
$container
47-
->getDefinition('webfactory_legacy_integration.legacy_application')
48-
->addMethodCall('setLegacyKernel', array($wrap));
49-
}
5038
}
5139
}

Resources/config/services.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,20 @@
55
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
66
<services>
77

8+
<service id="Webfactory\Bundle\LegacyIntegrationBundle\Integration\BootstrapFileKernelAdaptor">
9+
<argument>%webfactory_legacy_integration.legacy_application_bootstrap_file%</argument>
10+
</service>
11+
12+
<service id="webfactory_legacy_integration.legacy_kernel"
13+
alias="Webfactory\Bundle\LegacyIntegrationBundle\Integration\BootstrapFileKernelAdaptor" />
14+
815
<service
916
id="webfactory_legacy_integration.legacy_application"
1017
class="Webfactory\Bundle\LegacyIntegrationBundle\Integration\LegacyApplication"
1118
public="true">
19+
<call method="setLegacyKernel">
20+
<argument type="service" id="webfactory_legacy_integration.legacy_kernel" />
21+
</call>
1222
</service>
1323

1424
<service id="webfactory_legacy_integration.kernel_event_listener"

0 commit comments

Comments
 (0)