Skip to content

Commit

Permalink
bug #23686 [Console][WebServerBundle] Use "exec" when possible (nicol…
Browse files Browse the repository at this point in the history
…as-grekas)

This PR was merged into the 3.3 branch.

Discussion
----------

[Console][WebServerBundle] Use "exec" when possible

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23568
| License       | MIT
| Doc PR        | -

Commits
-------

7b6d894 [Console][WebServerBundle] Use "exec" when possible
  • Loading branch information
fabpot committed Jul 27, 2017
2 parents dd9b5eb + 7b6d894 commit b5c7319
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/Symfony/Bundle/WebServerBundle/WebServer.php
Expand Up @@ -13,7 +13,6 @@

use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Process\Exception\RuntimeException;

/**
Expand Down Expand Up @@ -151,11 +150,11 @@ private function createServerProcess(WebServerConfig $config)
throw new \RuntimeException('Unable to find the PHP binary.');
}

$builder = new ProcessBuilder(array($binary, '-S', $config->getAddress(), $config->getRouter()));
$builder->setWorkingDirectory($config->getDocumentRoot());
$builder->setTimeout(null);
$process = new Process(array($binary, '-S', $config->getAddress(), $config->getRouter()));
$process->setWorkingDirectory($config->getDocumentRoot());
$process->setTimeout(null);

return $builder->getProcess();
return $process;
}

private function getDefaultPidFile()
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/WebServerBundle/composer.json
Expand Up @@ -17,9 +17,9 @@
],
"require": {
"php": ">=5.5.9",
"symfony/console": "~2.8.8|~3.0.8|~3.1.2|~3.2",
"symfony/console": "~3.3",
"symfony/http-kernel": "~3.3",
"symfony/process": "~2.8|~3.0"
"symfony/process": "~3.3"
},
"autoload": {
"psr-4": { "Symfony\\Bundle\\WebServerBundle\\": "" },
Expand Down

0 comments on commit b5c7319

Please sign in to comment.