Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commite394597

Browse files
committed
[Process] Fixed issue between process builder and exec
refs#23495
1 parente8b9e25 commite394597

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines 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 =newProcess($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‎

Lines 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+
publicfunctiontestDoesNotPrefixExec()
215+
{
216+
$builder = ProcessBuilder::create(array('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)

[8]ページ先頭

©2009-2025 Movatter.jp