|
19 | 19 | use Symfony\Component\Console\Exception\LogicException;
|
20 | 20 | use Symfony\Component\Console\Input\InputArgument;
|
21 | 21 | use Symfony\Component\Console\Input\InputInterface;
|
| 22 | +use Symfony\Component\Console\Input\InputOption; |
22 | 23 | use Symfony\Component\Console\Output\OutputInterface;
|
23 | 24 | use Symfony\Component\Console\Style\SymfonyStyle;
|
24 | 25 | use Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass;
|
@@ -46,6 +47,7 @@ protected function configure()
|
46 | 47 | ->setDefinition([
|
47 | 48 | new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'),
|
48 | 49 | new InputArgument('path', InputArgument::OPTIONAL, 'The configuration option path'),
|
| 50 | + new InputOption('resolve-env', null, InputOption::VALUE_NONE, 'Display resolved environment variable values instead of placeholders'), |
49 | 51 | ])
|
50 | 52 | ->setHelp(<<<'EOF'
|
51 | 53 | The <info>%command.name%</info> command dumps the current configuration for an
|
@@ -94,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
|
94 | 96 | $extensionAlias = $extension->getAlias();
|
95 | 97 | $container = $this->compileContainer();
|
96 | 98 |
|
97 |
| - $config = $this->getConfig($extension, $container); |
| 99 | + $config = $this->getConfig($extension, $container, $input->getOption('resolve-env')); |
98 | 100 |
|
99 | 101 | if (null === $path = $input->getArgument('path')) {
|
100 | 102 | $io->title(
|
@@ -210,12 +212,12 @@ private function getAvailableBundles(bool $alias): array
|
210 | 212 | return $availableBundles;
|
211 | 213 | }
|
212 | 214 |
|
213 |
| - private function getConfig(ExtensionInterface $extension, ContainerBuilder $container) |
| 215 | + private function getConfig(ExtensionInterface $extension, ContainerBuilder $container, bool $resolveEnvs = false) |
214 | 216 | {
|
215 | 217 | return $container->resolveEnvPlaceholders(
|
216 | 218 | $container->getParameterBag()->resolveValue(
|
217 | 219 | $this->getConfigForExtension($extension, $container)
|
218 |
| - ) |
| 220 | + ), $resolveEnvs ?: null |
219 | 221 | );
|
220 | 222 | }
|
221 | 223 |
|
|
0 commit comments