Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit120a7e9

Browse files
committed
bug#10443 [FrameworkBundle] Use DIC parameter as default host value if available (romainneutron)
This PR was merged into the 2.5-dev branch.Discussion----------[FrameworkBundle] Use DIC parameter as default host value if available| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| License | MITThis follows#10439Commits-------85a2fbf [FrameworkBundle] Use DIC parameter as default host value if available
2 parentsb7c158a +85a2fbf commit120a7e9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ protected function configure()
5151
->setName('router:match')
5252
->setDefinition(array(
5353
newInputArgument('path_info', InputArgument::REQUIRED,'A path info'),
54-
newInputOption('method',null, InputOption::VALUE_REQUIRED,'Sets the HTTP method','GET'),
55-
newInputOption('host',null, InputOption::VALUE_REQUIRED,'Sets the HTTP host','localhost'),
54+
newInputOption('method',null, InputOption::VALUE_REQUIRED,'Sets the HTTP method'),
55+
newInputOption('host',null, InputOption::VALUE_REQUIRED,'Sets the HTTP host'),
5656
))
5757
->setDescription('Helps debug routes by simulating a path info match')
5858
->setHelp(<<<EOF
@@ -74,8 +74,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
7474
{
7575
$router =$this->getContainer()->get('router');
7676
$context =$router->getContext();
77-
$context->setMethod($input->getOption('method'));
78-
$context->setHost($input->getOption('host'));
77+
if (null !==$method =$input->getOption('method')) {
78+
$context->setMethod($method);
79+
}
80+
if (null !==$host =$input->getOption('host')) {
81+
$context->setHost($host);
82+
}
7983

8084
$matcher =newTraceableUrlMatcher($router->getRouteCollection(),$context);
8185

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp