Skip to content

Commit 91b1bec

Browse files
committed
Merge remote branch 'schniper/patch-2'
* schniper/patch-2: Fix process creation under Win7 Ultimate (app/console assetic:dump ./web): - Set the default $env to NULL, thus inheriting the system's environment settings (array() is no good). - Set bypass_shell to false, otherwise process creation will fail (I don't know if this should happen only on Win7)
2 parents 9714524 + 5841f05 commit 91b1bec

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Symfony/Component/Process/Process.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,25 @@ class Process
4646
*
4747
* @api
4848
*/
49-
public function __construct($commandline, $cwd = null, array $env = array(), $stdin = null, $timeout = 60, array $options = array())
49+
public function __construct($commandline, $cwd = null, array $env = null, $stdin = null, $timeout = 60, array $options = array())
5050
{
5151
if (!function_exists('proc_open')) {
5252
throw new \RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.');
5353
}
5454

5555
$this->commandline = $commandline;
5656
$this->cwd = null === $cwd ? getcwd() : $cwd;
57-
$this->env = array();
58-
foreach ($env as $key => $value) {
59-
$this->env[(binary) $key] = (binary) $value;
57+
if (null !== $env) {
58+
$this->env = array();
59+
foreach ($env as $key => $value) {
60+
$this->env[(binary) $key] = (binary) $value;
61+
}
62+
} else {
63+
$this->env = null;
6064
}
6165
$this->stdin = $stdin;
6266
$this->timeout = $timeout;
63-
$this->options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => true), $options);
67+
$this->options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false), $options);
6468
}
6569

6670
/**

0 commit comments

Comments
 (0)