You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Process.php
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,7 @@ public static function fromShellCommandline(string $command, string $cwd = null,
197
197
198
198
publicfunction__destruct()
199
199
{
200
-
if (!$this->options['create_new_console']) {
200
+
if (!($this->options['detach'] ?? $this->options['create_new_console'])) {
201
201
$this->stop(0);
202
202
} else {
203
203
$this->processPipes->close();
@@ -1228,24 +1228,24 @@ public function getStartTime(): float
1228
1228
* detach option can be used to run a process in the background
1229
1229
* using detach you can can finish execution before the process has finished working
1230
1230
* use setOptions(['detach' => true]) before using start
1231
+
* on Win you need both detach => true, and create_new_console => true, to start a bacground process and exit your main script without waiting for the process to finish
1231
1232
* detach requires minimum PHP 7.4.4.
1232
1233
*/
1233
1234
publicfunctionsetOptions(array$options)
1234
12
C6EC
35
{
1236
+
if ($this->isRunning()) {
1237
+
thrownewRuntimeException('Setting options while the process is running is not possible.');
0 commit comments