Skip to content

Commit ad88cdd

Browse files
committed
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
2 parents 6586eaa + e3f17f9 commit ad88cdd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ protected function configure()
5252
->setDefinition(array(
5353
new InputArgument('path_info', InputArgument::REQUIRED, 'A path info'),
5454
new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP method'),
55-
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the HTTP host'),
55+
new InputOption('scheme', null, InputOption::VALUE_REQUIRED, 'Sets the URI scheme (usually http or https)'),
56+
new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Sets the URI host'),
5657
))
5758
->setDescription('Helps debug routes by simulating a path info match')
5859
->setHelp(<<<EOF
59-
The <info>%command.name%</info> simulates a path info match:
60+
The <info>%command.name%</info> shows which routes match a given request and which don't and for what reason:
6061
6162
<info>php %command.full_name% /foo</info>
6263
or
63-
<info>php %command.full_name% /foo --method POST --host symfony.com</info>
64+
<info>php %command.full_name% /foo --method POST --scheme https --host symfony.com --verbose</info>
6465
6566
EOF
6667
)
@@ -77,6 +78,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
7778
if (null !== $method = $input->getOption('method')) {
7879
$context->setMethod($method);
7980
}
81+
if (null !== $scheme = $input->getOption('scheme')) {
82+
$context->setScheme($scheme);
83+
}
8084
if (null !== $host = $input->getOption('host')) {
8185
$context->setHost($host);
8286
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy