From a242f7e9ba50765573e142a9f033b548034cc261 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 12 Jul 2016 16:18:30 +0100 Subject: [PATCH] Use process component instead of passthru, fixes #5501 --- src/Composer/Command/HomeCommand.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Composer/Command/HomeCommand.php b/src/Composer/Command/HomeCommand.php index 05e89d248..18b37a256 100644 --- a/src/Composer/Command/HomeCommand.php +++ b/src/Composer/Command/HomeCommand.php @@ -118,19 +118,20 @@ EOT { $url = ProcessExecutor::escape($url); + $process = new ProcessExecutor($this->getIO()); if (Platform::isWindows()) { - return passthru('start "web" explorer "' . $url . '"'); + return $process->execute('start "web" explorer "' . $url . '"'); } - passthru('which xdg-open', $linux); - passthru('which open', $osx); + $linux = $process->execute('which xdg-open'); + $osx = $process->execute('which open'); if (0 === $linux) { - passthru('xdg-open ' . $url); + $process->execute('xdg-open ' . $url); } elseif (0 === $osx) { - passthru('open ' . $url); + $process->execute('open ' . $url); } 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); } }