Content-Length: 300302 | pFad | http://github.com/symfony/process/commit/87b7c93e57df9d8e39a093d32587702380ff045d

97 Merge branch '6.4' into 7.2 · symfony/process@87b7c93 · GitHub
Skip to content

Commit 87b7c93

Browse files
Merge branch '6.4' into 7.2
* 6.4: [VarExporter] Fix support for hooks and asymmetric visibility fix(process): use a pipe for stderr in pty mode to avoid mixed output between stdout and stderr [Cache] fix data collector
2 parents d8f411f + e2a61c1 commit 87b7c93

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Pipes/UnixPipes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getDescriptors(): array
7070
return [
7171
['pty'],
7272
['pty'],
73-
['pty'],
73+
['pipe', 'w'], // stderr needs to be in a pipe to correctly split error and output, since PHP will use the same stream for both
7474
];
7575
}
7676

Tests/ProcessTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,20 @@ public function testExitCodeTextIsNullWhenExitCodeIsNull()
559559
$this->assertNull($process->getExitCodeText());
560560
}
561561

562+
public function testStderrNotMixedWithStdout()
563+
{
564+
if (!Process::isPtySupported()) {
565+
$this->markTestSkipped('PTY is not supported on this operating system.');
566+
}
567+
568+
$process = $this->getProcess('echo "foo" && echo "bar" >&2');
569+
$process->setPty(true);
570+
$process->run();
571+
572+
$this->assertSame("foo\r\n", $process->getOutput());
573+
$this->assertSame("bar\n", $process->getErrorOutput());
574+
}
575+
562576
public function testPTYCommand()
563577
{
564578
if (!Process::isPtySupported()) {

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/symfony/process/commit/87b7c93e57df9d8e39a093d32587702380ff045d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy