[Process] minor fixes

This commit is contained in:
Andrey Ryaguzov 2014-02-21 11:41:38 +04:00 committed by Fabien Potencier
parent 7ee758c5fb
commit f03e5dcd40
2 changed files with 8 additions and 2 deletions

View File

@ -812,7 +812,9 @@ class Process
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) {
@ -1038,6 +1040,7 @@ class Process
* 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)
{

View File

@ -76,7 +76,7 @@ class ProcessPipes
public function close()
{
$this->closeUnixPipes();
foreach ($this->fileHandles as $offset => $handle) {
foreach ($this->fileHandles as $handle) {
fclose($handle);
}
$this->fileHandles = array();
@ -218,6 +218,8 @@ class ProcessPipes
/**
* 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)
@ -253,6 +255,7 @@ class ProcessPipes
* 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.
*/