Skip to content

Commit

Permalink
added route debug information when path matches url
Browse files Browse the repository at this point in the history
included required class
  • Loading branch information
inmarelibero authored and fabpot committed Mar 23, 2013
1 parent 1d778cf commit c46e3e1
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -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']));
Expand Down

0 comments on commit c46e3e1

Please sign in to comment.