8000 bug #12253 [FrameworkBundle] improve server commands feedback (xabbuh) · symfony/symfony@4fe8eda · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 4fe8eda

Browse files
committed
bug #12253 [FrameworkBundle] improve server commands feedback (xabbuh)
This PR was merged into the 2.6-dev branch. Discussion ---------- [FrameworkBundle] improve server commands feedback | Q | A | ------------- | --- | Bug fix? | no | New feature? | kind of | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12153 | License | MIT | Doc PR | * display a message when `server:start` is executed and the PCNTL extension is not loaded * print instructions about how to terminate the `server:run` command Commits ------- bf174cf [FrameworkBundle] improve server commands feedback
2 parents 0e6465a + bf174cf commit 4fe8eda

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ public function isEnabled()
2727
return false;
2828
}
2929

30-
if (!extension_loaded('pcntl')) {
31-
return false;
32-
}
33-
3430
return parent::isEnabled();
3531
}
3632

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9797
}
9898

9999
$output->writeln(sprintf("Server running on <info>http://%s</info>\n", $input->getArgument('address')));
100+
$output->writeln('Quit the server with CONTROL-C.');
100101

101102
$builder = $this->createPhpProcessBuilder($input, $output, $env);
102103
$builder->setWorkingDirectory($documentRoot);

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ protected function configure()
7070
*/
7171
protected function execute(InputInterface $input, OutputInterface $output)
7272
{
73+
if (!extension_loaded('pcntl')) {
74+
$output->writeln('<error>This command needs the pcntl extension to run.</error>');
75+
$output->writeln('You can either install it or use the <info>server:run</info> command instead to run the built-in web server.');
76+
77+
return 1;
78+
}
79+
7380
$env = $this->getContainer()->getParameter('kernel.environment');
7481

7582
if ('prod' === $env) {

0 commit comments

Comments
 (0)
0