[Process] minor fixes
This commit is contained in:
parent
7ee758c5fb
commit
f03e5dcd40
@ -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)
|
||||
{
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user