Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8c0b731

Browse filesBrowse files
committed
[Process] Fixed issue between process builder and exec
refs #23495
1 parent e8b9e25 commit 8c0b731
Copy full SHA for 8c0b731

File tree

2 files changed

+15
-0
lines changed
Filter options

2 files changed

+15
-0
lines changed

‎src/Symfony/Component/Process/ProcessBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/ProcessBuilder.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ public function getProcess()
272272

273273
$arguments = array_merge($this->prefix, $this->arguments);
274274
$process = new Process($arguments, $this->cwd, $this->env, $this->input, $this->timeout, $this->options);
275+
// to preserve the BC with symfony <3.3, we convert the array structure
276+
// to a string structure to avoid the prefixing with the exec binary
277+
$process->setCommandLine($process->getCommandLine());
275278

276279
if ($this->inheritEnv) {
277280
$process->inheritEnvironmentVariables();

‎src/Symfony/Component/Process/Tests/ProcessBuilderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Process/Tests/ProcessBuilderTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,16 @@ public function testInvalidInput()
210210
$builder = ProcessBuilder::create();
211211
$builder->setInput(array());
212212
}
213+
214+
public function testDoesNotPrefixExec()
215+
{
216+
$builder = ProcessBuilder::create(['a', 'b']);
217+
$process = $builder->getProcess();
218+
219+
$r = new \ReflectionObject($process);
220+
$p = $r->getProperty('commandline');
221+
$p->setAccessible(true);
222+
223+
$this->assertSame("'a' 'b'", $p->getValue($process));
224+
}
213225
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.