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
This commit is contained in:
Fabien Potencier 2015-12-07 22:55:06 +01:00
commit b8fbe69bb8
3 changed files with 5 additions and 17 deletions

View File

@ -27,6 +27,10 @@ abstract class ServerCommand extends ContainerAwareCommand
return false;
}
if (!class_exists('Symfony\Component\Process\Process')) {
return false;
}
return parent::isEnabled();
}

View File

@ -25,22 +25,6 @@ use Symfony\Component\Process\ProcessBuilder;
*/
class ServerRunCommand extends ServerCommand
{
/**
* {@inheritdoc}
*/
public function isEnabled()
{
if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
return false;
}
if (!class_exists('Symfony\Component\Process\Process')) {
return false;
}
return parent::isEnabled();
}
/**
* {@inheritdoc}
*/

View File

@ -54,7 +54,7 @@
"symfony/serializer": "For using the serializer service",
"symfony/validator": "For using validation",
"symfony/yaml": "For using the debug:config and lint:yaml commands",
"symfony/process": "For using the server:run command",
"symfony/process": "For using the server:run, server:start, server:stop, and server:status commands",
"doctrine/cache": "For using alternative cache drivers"
},
"autoload": {