Browse files

added route debug information when path matches url

included required class
  • Loading branch information...
1 parent 1d778cf commit c46e3e17486b5d31f455bfa9e544df4daab3b8eb @inmarelibero inmarelibero committed with fabpot Feb 2, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php
View
6 src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php
@@ -14,6 +14,7 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Routing\Matcher\TraceableUrlMatcher;
@@ -76,6 +77,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln(sprintf('<fg=yellow>Route "%s" almost matches but %s</>', $trace['name'], lcfirst($trace['log'])));
} elseif (TraceableUrlMatcher::ROUTE_MATCHES == $trace['level']) {
$output->writeln(sprintf('<fg=green>Route "%s" matches</>', $trace['name']));
+
+ $routerDebugcommand = $this->getApplication()->find('router:debug');
+ $output->writeln('');
+ $routerDebugcommand->run(new ArrayInput(array('name' => $trace['name'])), $output);
+
$matches = true;
} elseif ($input->getOption('verbose')) {
$output->writeln(sprintf('Route "%s" does not match: %s', $trace['name'], $trace['log']));

0 comments on commit c46e3e1

Please sign in to comment.