/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Utility
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/bake/src/Utility/Process.php (2070B)
io = $io;
}
/**
* Call a subprocess
*
* @param string $command The command to call
* @return string The output
* @throws \RuntimeException Raised when the called command fails.
*/
public function call(string $command): string
{
$descriptorSpec = [
0 => ['pipe', 'r'],
1 => ['pipe', 'w'],
2 => ['pipe', 'w'],
];
$this->io->verbose('Running ' . $command);
$process = proc_open(
$command,
$descriptorSpec,
$pipes
);
if (!is_resource($process)) {
throw new RuntimeException("Could not start subprocess for `$command`");
}
fclose($pipes[0]);
$output = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$error = stream_get_contents($pipes[2]);
fclose($pipes[2]);
$exit = proc_close($process);
if ($exit !== 0) {
throw new \RuntimeException($error);
}
return $output;
}
}