diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index f5c777bf3..2395e8d40 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -32,11 +32,15 @@ abstract class ArchiveDownloader extends FileDownloader parent::download($package, $path); $fileName = $this->getFileName($package, $path); - $this->io->write(' Unpacking archive'); + if ($this->io->isVerbose()) { + $this->io->write(' Unpacking archive'); + } try { $this->extract($fileName, $path); - $this->io->write(' Cleaning up'); + if ($this->io->isVerbose()) { + $this->io->write(' Cleaning up'); + } unlink($fileName); // If we have only a one dir inside it suppose to be a package itself diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index ea8baabc5..5c782a330 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -80,12 +80,14 @@ class GitDownloader extends VcsDownloader */ protected function runCommand($commandCallable, $url, $path = null) { + $handler = array($this, 'outputHandler'); + // github, autoswitch protocols if (preg_match('{^(?:https?|git)(://github.com/.*)}', $url, $match)) { $protocols = array('git', 'https', 'http'); foreach ($protocols as $protocol) { $url = escapeshellarg($protocol . $match[1]); - if (0 === $this->process->execute(call_user_func($commandCallable, $url), $ignoredOutput)) { + if (0 === $this->process->execute(call_user_func($commandCallable, $url), $handler)) { return; } if (null !== $path) { @@ -97,11 +99,21 @@ class GitDownloader extends VcsDownloader $url = escapeshellarg($url); $command = call_user_func($commandCallable, $url); - if (0 !== $this->process->execute($command, $ignoredOutput)) { + if (0 !== $this->process->execute($command, $handler)) { throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput()); } } + public function outputHandler($type, $buffer) + { + if ($type !== 'out') { + return; + } + if ($this->io->isVerbose()) { + $this->io->write($buffer, false); + } + } + protected function setPushUrl(PackageInterface $package, $path) { // set push url for github projects