function Terminal::readFromProcess
2 calls to Terminal::readFromProcess()
- Terminal::getConsoleMode in vendor/
symfony/ console/ Terminal.php - Runs and parses mode CON if it's available, suppressing any error output.
- Terminal::getSttyColumns in vendor/
symfony/ console/ Terminal.php - Runs and parses stty -a if it's available, suppressing any error output.
File
-
vendor/
symfony/ console/ Terminal.php, line 199
Class
Namespace
Symfony\Component\ConsoleCode
private static function readFromProcess(string|array $command) : ?string {
if (!\function_exists('proc_open')) {
return null;
}
$descriptorspec = [
1 => [
'pipe',
'w',
],
2 => [
'pipe',
'w',
],
];
$cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0;
if (!($process = @proc_open($command, $descriptorspec, $pipes, null, null, [
'suppress_errors' => true,
]))) {
return null;
}
$info = stream_get_contents($pipes[1]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);
if ($cp) {
sapi_windows_cp_set($cp);
}
return $info;
}