|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\Command; |
13 | 13 |
|
14 | | -use Symfony\Component\Config\Definition\Processor; |
15 | 14 | use Symfony\Component\Console\Exception\LogicException; |
16 | 15 | use Symfony\Component\Console\Input\InputArgument; |
17 | 16 | use Symfony\Component\Console\Input\InputInterface; |
18 | 17 | use Symfony\Component\Console\Output\OutputInterface; |
19 | 18 | use Symfony\Component\Console\Style\SymfonyStyle; |
| 19 | +use Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass; |
20 | 20 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
21 | 21 | use Symfony\Component\Yaml\Yaml; |
22 | 22 |
|
@@ -80,15 +80,19 @@ protected function execute(InputInterface $input, OutputInterface $output) |
80 | 80 | $container = $this->compileContainer(); |
81 | 81 |
|
82 | 82 | $extensionAlias = $extension->getAlias(); |
83 | | - $configs = $container->getExtensionConfig($extensionAlias); |
84 | | - $configuration = $extension->getConfiguration($configs, $container); |
85 | | - |
86 | | - $this->validateConfiguration($extension, $configuration); |
| 83 | + $extensionConfig = []; |
| 84 | + foreach ($container->getCompilerPassConfig()->getPasses() as $pass) { |
| 85 | + if ($pass instanceof ValidateEnvPlaceholdersPass) { |
| 86 | + $extensionConfig = $pass->getExtensionConfig(); |
| 87 | + break; |
| 88 | + } |
| 89 | + } |
87 | 90 |
|
88 | | - $configs = $container->resolveEnvPlaceholders($container->getParameterBag()->resolveValue($configs)); |
| 91 | + if (!isset($extensionConfig[$extensionAlias])) { |
| 92 | + throw new \LogicException(sprintf('The extension with alias "%s" does not have configuration.', $extensionAlias)); |
| 93 | + } |
89 | 94 |
|
90 | | - $processor = new Processor(); |
91 | | - $config = $container->resolveEnvPlaceholders($container->getParameterBag()->resolveValue($processor->processConfiguration($configuration, $configs))); |
| 95 | + $config = $container->resolveEnvPlaceholders($extensionConfig[$extensionAlias]); |
92 | 96 |
|
93 | 97 | if (null === $path = $input->getArgument('path')) { |
94 | 98 | $io->title( |
|
0 commit comments