Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c78a42c
commit 3a001ab
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class RouterDebugCommand extends ContainerAwareCommand | ||
{ | ||
... | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('debug:router') | ||
->setAliases(array( | ||
'router:debug', | ||
)) | ||
->setDefinition(array( | ||
new InputArgument('name', InputArgument::OPTIONAL, 'A route name'), | ||
new InputOption('show-controllers', null, InputOption::VALUE_NONE, 'Show assigned controllers in overview'), | ||
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), | ||
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw route(s)'), | ||
)) | ||
->setDescription('Displays current routes for an application') | ||
->setHelp(<<<EOF | ||
The <info>%command.name%</info> displays the configured routes: | ||
|
||
<info>php %command.full_name%</info> | ||
|
||
EOF | ||
) | ||
; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* @throws \InvalidArgumentException When route does not exist | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
... | ||
$name = $input->getArgument('name'); | ||
... | ||
} | ||
... |