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

Commit94e4706

Browse files
peterrehmnicolas-grekas
authored andcommitted
Fixed server status command when port has been omitted
1 parent4f7c6ce commit94e4706

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
useSymfony\Component\Console\Input\InputArgument;
1515
useSymfony\Component\Console\Input\InputInterface;
16+
useSymfony\Component\Console\Input\InputOption;
1617
useSymfony\Component\Console\Output\OutputInterface;
1718

1819
/**
@@ -31,6 +32,7 @@ protected function configure()
3132
$this
3233
->setDefinition(array(
3334
newInputArgument('address', InputArgument::OPTIONAL,'Address:port','127.0.0.1:8000'),
35+
newInputOption('port','p', InputOption::VALUE_REQUIRED,'Address port number','8000'),
3436
))
3537
->setName('server:status')
3638
->setDescription('Outputs the status of the built-in web server for the given address')
@@ -44,6 +46,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
4446
{
4547
$address =$input->getArgument('address');
4648

49+
if (false ===strpos($address,':')) {
50+
$address =$address.':'.$input->getOption('port');
51+
}
52+
4753
// remove an orphaned lock file
4854
if (file_exists($this->getLockFile($address)) && !$this->isServerRunning($address)) {
4955
unlink($this->getLockFile($address));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp