info('Running "' . $cmd . '"'); } $val = ''; $process = new Process($cmd); $process->run(function ($type, $buffer) use ($return, $val) { if ($return) { $val .= $buffer; } else { echo $buffer; } /*if (Process::ERR === $type) { echo $buffer; } else { echo $buffer; }*/ }); return $val; } }