Skip to content

Commit b8fbe69

Browse files
committed
bug #16871 [FrameworkBundle] Disable built-in server commands when Process component is missing (gnugat, xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Disable built-in server commands when Process component is missing | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This also backports the improvement for the `suggest` section from #16650 to the `2.7` branch and improves it by also mentioning the other built-in server commands. Commits ------- 972c4ca disable server commands without Process component dd82b64 list all server command names in suggestion d18fb9b Suggested Process dependency
2 parents 52915ed + 972c4ca commit b8fbe69

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public function isEnabled()
2727
return false;
2828
}
2929

30+
if (!class_exists('Symfony\Component\Process\Process')) {
31+
return false;
32+
}
33+
3034
return parent::isEnabled();
3135
}
3236

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

-16
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,6 @@
2525
*/
2626
class ServerRunCommand extends ServerCommand
2727
{
28-
/**
29-
* {@inheritdoc}
30-
*/
31-
public function isEnabled()
32-
{
33-
if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
34-
return false;
35-
}
36-
37-
if (!class_exists('Symfony\Component\Process\Process')) {
38-
return false;
39-
}
40-
41-
return parent::isEnabled();
42-
}
43-
4428
/**
4529
* {@inheritdoc}
4630
*/

src/Symfony/Bundle/FrameworkBundle/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"symfony/serializer": "For using the serializer service",
5555
"symfony/validator": "For using validation",
5656
"symfony/yaml": "For using the debug:config and lint:yaml commands",
57-
"symfony/process": "For using the server:run command",
57+
"symfony/process": "For using the server:run, server:start, server:stop, and server:status commands",
5858
"doctrine/cache": "For using alternative cache drivers"
5959
},
6060
"autoload": {

0 commit comments

Comments
 (0)