Permalink
Browse files

merged branch lsmith77/config_dump_ref_list_bundles (PR #7578)

This PR was submitted for the 2.1 branch but it was merged into the master branch instead (closes #7578).

Discussion
----------

dump the list of available bundles (and extension alaises) if no name is provided

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Not sure if this should only go into master or if such a small tweak can also go into 2.1 or at least 2.2

Commits
-------

2ba6fca dump the list of available bundles (and extension alaises) if no name is provided
  • Loading branch information...
2 parents 6d552c9 + d36f4ae commit ef52139310bdecf21c9de3122e9b4ea1781cf71d @fabpot fabpot committed Apr 7, 2013
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
@@ -32,7 +32,7 @@ protected function configure()
$this
->setName('config:dump-reference')
->setDefinition(array(
- new InputArgument('name', InputArgument::REQUIRED, 'The Bundle or extension alias')
+ new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias')
))
->setDescription('Dumps default configuration for an extension')
->setHelp(<<<EOF
@@ -64,6 +64,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
$name = $input->getArgument('name');
+ if (empty($name)) {
+ $output->writeln('Available registered bundles with their extension alias if available:');
+ foreach ($bundles as $bundle) {
+ $extension = $bundle->getContainerExtension();
+ $output->writeln($bundle->getName().($extension ? ': '.$extension->getAlias() : ''));
+ }
+
+ return;
+ }
+
$extension = null;
if (preg_match('/Bundle$/', $name)) {

0 comments on commit ef52139

Please sign in to comment.