Skip to content

Commit 495f77a

Browse files
[Process] Inherit env vars by default
1 parent 613910b commit 495f77a

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

src/Symfony/Component/BrowserKit/Client.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,7 @@ public function request($method, $uri, array $parameters = array(), array $files
334334
*/
335335
protected function doRequestInProcess($request)
336336
{
337-
// We set the TMPDIR (for Macs) and TEMP (for Windows), because on these platforms the temp directory changes based on the user.
338-
$process = new PhpProcess($this->getScript($request), null, array('TMPDIR' => sys_get_temp_dir(), 'TEMP' => sys_get_temp_dir()));
337+
$process = new PhpProcess($this->getScript($request), null, null);
339338
$process->run();
340339

341340
if (!$process->isSuccessful() || !preg_match('/^O\:\d+\:/', $process->getOutput())) {

src/Symfony/Component/BrowserKit/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"symfony/dom-crawler": "~2.0,>=2.0.5"
2121
},
2222
"require-dev": {
23-
"symfony/process": "~2.0,>=2.0.5",
23+
"symfony/process": "~2.3,>=2.3.34|~2.7,>=2.7.6",
2424
"symfony/css-selector": "~2.0,>=2.0.5"
2525
},
2626
"suggest": {

src/Symfony/Component/ClassLoader/ClassCollectionLoader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private static function getClassHierarchy(\ReflectionClass $class)
283283

284284
$traits = array();
285285

286-
if (function_exists('get_declared_traits')) {
286+
if (method_exists('ReflectionClass', 'getTraits')) {
287287
foreach ($classes as $c) {
288288
foreach (self::resolveDependencies(self::computeTraitDeps($c), $c) as $trait) {
289289
if ($trait !== $c) {

src/Symfony/Component/Process/PhpProcess.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ class PhpProcess extends Process
2727
/**
2828
* Constructor.
2929
*
30-
* @param string $script The PHP script to run (as a string)
31-
* @param string $cwd The working directory
32-
* @param array $env The environment variables
33-
* @param int $timeout The timeout in seconds
34-
* @param array $options An array of options for proc_open
30+
* @param string $script The PHP script to run (as a string)
31+
* @param string|null $cwd The working directory
32+
* @param array|null $env The environment variables
33+
* @param int $timeout The timeout in seconds
34+
* @param array $options An array of options for proc_open
3535
*/
36-
public function __construct($script, $cwd = null, array $env = array(), $timeout = 60, array $options = array())
36+
public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = array())
3737
{
3838
$executableFinder = new PhpExecutableFinder();
3939
if (false === $php = $executableFinder->find()) {

src/Symfony/Component/Process/Process.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public function setEnv(array $env)
851851

852852
$this->env = array();
853853
foreach ($env as $key => $value) {
854-
$this->env[(binary) $key] = (binary) $value;
854+
$this->env[$key] = (string) $value;
855855
}
856856

857857
return $this;

0 commit comments

Comments
 (0)