merged branch ganchiku/compiledroute_bcbreak_fix (PR #5333)

Commits
-------

472dfdc oops, the command with name, too
b1a9587 fixed bug related to the change PR #5326

Discussion
----------

fixed bug related to the change PR #5326

PR #5326 cause error on debugging command for route. compiledroute does not have getRequirements anymore, so should use not compiled route instead.
This commit is contained in:
Fabien Potencier 2012-08-24 16:48:05 +02:00
commit a1e6cfbe15
1 changed files with 2 additions and 6 deletions

View File

@ -77,10 +77,7 @@ EOF
protected function outputRoutes(OutputInterface $output, $routes = null)
{
if (null === $routes) {
$routes = array();
foreach ($this->getContainer()->get('router')->getRouteCollection()->all() as $name => $route) {
$routes[$name] = $route->compile();
}
$routes = $this->getContainer()->get('router')->getRouteCollection()->all();
}
$output->writeln($this->getHelper('formatter')->formatSection('router', 'Current routes'));
@ -131,7 +128,6 @@ EOF
$output->writeln($this->getHelper('formatter')->formatSection('router', sprintf('Route "%s"', $name)));
$route = $route->compile();
$output->writeln(sprintf('<comment>Name</comment> %s', $name));
$output->writeln(sprintf('<comment>Pattern</comment> %s', $route->getPattern()));
$output->writeln(sprintf('<comment>Class</comment> %s', get_class($route)));
@ -160,7 +156,7 @@ EOF
}
$output->writeln(sprintf('<comment>Options</comment> %s', $options));
$output->write('<comment>Regex</comment> ');
$output->writeln(preg_replace('/^ /', '', preg_replace('/^/m', ' ', $route->getRegex())), OutputInterface::OUTPUT_RAW);
$output->writeln(preg_replace('/^ /', '', preg_replace('/^/m', ' ', $route->compile()->getRegex())), OutputInterface::OUTPUT_RAW);
}
protected function formatValue($value)