feature #10509 [FrameworkBundle] add scheme option to router:match command (Tobion)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[FrameworkBundle] add scheme option to router:match command

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

Continuation of #10439

Commits
-------

e3f17f9 add scheme option to router:match command
This commit is contained in:
Fabien Potencier 2014-03-24 19:03:50 +01:00
commit ad88cdd44e

View File

@ -52,15 +52,16 @@ class RouterMatchCommand extends ContainerAwareCommand
->setDefinition(array(
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method'),
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP host'),
new InputOption('scheme', null, InputOption::VALUE_REQUIRED, 'Sets the URI scheme (usually http or https)'),
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the URI host'),
))
->setDescription('Helps debug routes by simulating a path info match')
->setHelp(<<<EOF
The <info>%command.name%</info> simulates a path info match:
The <info>%command.name%</info> shows which routes match a given request and which don't and for what reason:
<info>php %command.full_name% /foo</info>
or
<info>php %command.full_name% /foo --method POST --host symfony.com</info>
<info>php %command.full_name% /foo --method POST --scheme https --host symfony.com --verbose</info>
EOF
)
@ -77,6 +78,9 @@ EOF
if (null !== $method = $input->getOption('method')) {
$context->setMethod($method);
}
if (null !== $scheme = $input->getOption('scheme')) {
$context->setScheme($scheme);
}
if (null !== $host = $input->getOption('host')) {
$context->setHost($host);
}