Use process component instead of passthru, fixes #5501
parent
7bcd336c95
commit
a242f7e9ba
|
@ -118,19 +118,20 @@ EOT
|
||||||
{
|
{
|
||||||
$url = ProcessExecutor::escape($url);
|
$url = ProcessExecutor::escape($url);
|
||||||
|
|
||||||
|
$process = new ProcessExecutor($this->getIO());
|
||||||
if (Platform::isWindows()) {
|
if (Platform::isWindows()) {
|
||||||
return passthru('start "web" explorer "' . $url . '"');
|
return $process->execute('start "web" explorer "' . $url . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
passthru('which xdg-open', $linux);
|
$linux = $process->execute('which xdg-open');
|
||||||
passthru('which open', $osx);
|
$osx = $process->execute('which open');
|
||||||
|
|
||||||
if (0 === $linux) {
|
if (0 === $linux) {
|
||||||
passthru('xdg-open ' . $url);
|
$process->execute('xdg-open ' . $url);
|
||||||
} elseif (0 === $osx) {
|
} elseif (0 === $osx) {
|
||||||
passthru('open ' . $url);
|
$process->execute('open ' . $url);
|
||||||
} else {
|
} else {
|
||||||
$this->getIO()->writeError('no suitable browser opening command found, open yourself: ' . $url);
|
$this->getIO()->writeError('No suitable browser opening command found, open yourself: ' . $url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue