Skip to content

Commit b1f96c6

Browse files
authored
Let symfony/process build correct serve commandline (#34151)
1 parent 680c3db commit b1f96c6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Illuminate/Foundation/Console/ServeCommand.php

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Env;
7-
use Illuminate\Support\ProcessUtils;
87
use Symfony\Component\Console\Input\InputOption;
98
use Symfony\Component\Process\PhpExecutableFinder;
109
use Symfony\Component\Process\Process;
@@ -93,7 +92,7 @@ public function handle()
9392
*/
9493
protected function startProcess()
9594
{
96-
$process = Process::fromShellCommandline($this->serverCommand(), null, collect($_ENV)->mapWithKeys(function ($value, $key) {
95+
$process = new Process($this->serverCommand(), null, collect($_ENV)->mapWithKeys(function ($value, $key) {
9796
return [$key => false];
9897
})->all());
9998

@@ -107,16 +106,16 @@ protected function startProcess()
107106
/**
108107
* Get the full server command.
109108
*
110-
* @return string
109+
* @return array
111110
*/
112111
protected function serverCommand()
113112
{
114-
return sprintf('%s -S %s:%s %s',
115-
ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)),
116-
$this->host(),
117-
$this->port(),
118-
ProcessUtils::escapeArgument(base_path('server.php'))
119-
);
113+
return [
114+
(new PhpExecutableFinder)->find(false),
115+
'-S',
116+
$this->host() . ':' . $this->port(),
117+
base_path('server.php')
118+
];
120119
}
121120

122121
/**

0 commit comments

Comments
 (0)