Skip to content

Commit

Permalink
[Process] minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Ryaguzov authored and fabpot committed Feb 24, 2014
1 parent 7ee758c commit f03e5dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Symfony/Component/Process/Process.php
Expand Up @@ -812,7 +812,9 @@ public function getEnv()
public function setEnv(array $env)
{
// Process can not handle env values that are arrays
$env = array_filter($env, function ($value) { if (!is_array($value)) { return true; } });
$env = array_filter($env, function ($value) {
return !is_array($value);
});

$this->env = array();
foreach ($env as $key => $value) {
Expand Down Expand Up @@ -1038,6 +1040,7 @@ protected function isSigchildEnabled()
* Reads pipes, executes callback.
*
* @param Boolean $blocking Whether to use blocking calls or not.
* @param Boolean $close Whether to close file handles or not.
*/
private function readPipes($blocking, $close)
{
Expand Down
5 changes: 4 additions & 1 deletion src/Symfony/Component/Process/ProcessPipes.php
Expand Up @@ -76,7 +76,7 @@ public function unblock()
public function close()
{
$this->closeUnixPipes();
foreach ($this->fileHandles as $offset => $handle) {
foreach ($this->fileHandles as $handle) {
fclose($handle);
}
$this->fileHandles = array();
Expand Down Expand Up @@ -218,6 +218,8 @@ public function write($blocking, $stdin)
/**
* Reads data in file handles.
*
* @param Boolean $close Whether to close file handles or not.
*
* @return array An array of read data indexed by their fd.
*/
private function readFileHandles($close = false)
Expand Down Expand Up @@ -253,6 +255,7 @@ private function readFileHandles($close = false)
* Reads data in file pipes streams.
*
* @param Boolean $blocking Whether to use blocking calls or not.
* @param Boolean $close Whether to close file handles or not.
*
* @return array An array of read data indexed by their fd.
*/
Expand Down

0 comments on commit f03e5dc

Please sign in to comment.