protected function procExec($command, array &$output = null, &$return_var = -1, array &$error_output = null)
{
$descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w"));
$process = proc_open($command, $descriptorspec, $pipes, null, null);
if (is_resource($process)) {
fclose($pipes[0]);
$tmpout = '';
$tmperr = '';
$output = stream_get_contents($pipes[1]);
$error_output = stream_get_contents($pipes[2]);
fclose($pipes[1]);
fclose($pipes[2]);
$return_var = proc_close($process);
}
return $return_var;
}