diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php
index 30c80355c..07254dc53 100644
--- a/src/Composer/IO/ConsoleIO.php
+++ b/src/Composer/IO/ConsoleIO.php
@@ -55,6 +55,14 @@ class ConsoleIO implements IOInterface
return $this->input->isInteractive();
}
+ /**
+ * {@inheritDoc}
+ */
+ public function isVerbose()
+ {
+ return (Boolean) $this->input->getOption('verbose');
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/src/Composer/IO/IOInterface.php b/src/Composer/IO/IOInterface.php
index 1b84daab7..5b540892a 100644
--- a/src/Composer/IO/IOInterface.php
+++ b/src/Composer/IO/IOInterface.php
@@ -26,6 +26,13 @@ interface IOInterface
*/
function isInteractive();
+ /**
+ * Is this input verbose?
+ *
+ * @return Boolean
+ */
+ function isVerbose();
+
/**
* Writes a message to the output.
*
diff --git a/src/Composer/IO/NullIO.php b/src/Composer/IO/NullIO.php
index 4d854b534..b57e42087 100644
--- a/src/Composer/IO/NullIO.php
+++ b/src/Composer/IO/NullIO.php
@@ -27,6 +27,14 @@ class NullIO implements IOInterface
return false;
}
+ /**
+ * {@inheritDoc}
+ */
+ public function isVerbose()
+ {
+ return false;
+ }
+
/**
* {@inheritDoc}
*/
diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php
index 96509d3b3..fd8f4b8a4 100644
--- a/src/Composer/Repository/VcsRepository.php
+++ b/src/Composer/Repository/VcsRepository.php
@@ -27,7 +27,7 @@ class VcsRepository extends ArrayRepository
{
protected $url;
protected $packageName;
- protected $debug;
+ protected $verbose;
protected $io;
protected $versionParser;
protected $type;
@@ -46,11 +46,7 @@ class VcsRepository extends ArrayRepository
$this->url = $config['url'];
$this->io = $io;
$this->type = isset($config['type']) ? $config['type'] : 'vcs';
- }
-
- public function setDebug($debug)
- {
- $this->debug = $debug;
+ $this->verbose = $io->isVerbose();
}
public function getDriver()
@@ -83,7 +79,7 @@ class VcsRepository extends ArrayRepository
{
parent::initialize();
- $debug = $this->debug;
+ $verbose = $this->verbose;
$driver = $this->getDriver();
if (!$driver) {
@@ -99,21 +95,21 @@ class VcsRepository extends ArrayRepository
$this->packageName = !empty($data['name']) ? $data['name'] : null;
}
} catch (\Exception $e) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped parsing '.$driver->getRootIdentifier().', '.$e->getMessage());
}
}
foreach ($driver->getTags() as $tag => $identifier) {
- $msg = 'Get composer info for ' . $this->packageName . ' (' . $tag . ')';
- if ($debug) {
+ $msg = 'Get composer info for ' . ($this->packageName ?: $this->url) . ' (' . $tag . ')';
+ if ($verbose) {
$this->io->write($msg);
} else {
$this->io->overwrite($msg, false);
}
if (!$parsedTag = $this->validateTag($tag)) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped tag '.$tag.', invalid tag name');
}
continue;
@@ -121,13 +117,13 @@ class VcsRepository extends ArrayRepository
try {
if (!$data = $driver->getComposerInformation($identifier)) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped tag '.$tag.', no composer file');
}
continue;
}
} catch (\Exception $e) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()));
}
continue;
@@ -148,13 +144,13 @@ class VcsRepository extends ArrayRepository
// broken package, version doesn't match tag
if ($data['version_normalized'] !== $parsedTag) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped tag '.$tag.', tag ('.$parsedTag.') does not match version ('.$data['version_normalized'].') in composer.json');
}
continue;
}
- if ($debug) {
+ if ($verbose) {
$this->io->write('Importing tag '.$tag.' ('.$data['version_normalized'].')');
}
@@ -164,15 +160,15 @@ class VcsRepository extends ArrayRepository
$this->io->overwrite('', false);
foreach ($driver->getBranches() as $branch => $identifier) {
- $msg = 'Get composer info for ' . $this->packageName . ' (' . $branch . ')';
- if ($debug) {
+ $msg = 'Get composer info for ' . ($this->packageName ?: $this->url) . ' (' . $branch . ')';
+ if ($verbose) {
$this->io->write($msg);
} else {
$this->io->overwrite($msg, false);
}
if (!$parsedBranch = $this->validateBranch($branch)) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped branch '.$branch.', invalid name');
}
continue;
@@ -180,13 +176,13 @@ class VcsRepository extends ArrayRepository
try {
if (!$data = $driver->getComposerInformation($identifier)) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped branch '.$branch.', no composer file');
}
continue;
}
} catch (TransportException $e) {
- if ($debug) {
+ if ($verbose) {
$this->io->write('Skipped branch '.$branch.', no composer file was found');
}
continue;
@@ -206,7 +202,7 @@ class VcsRepository extends ArrayRepository
$data['version'] = $data['version'] . '-dev';
}
- if ($debug) {
+ if ($verbose) {
$this->io->write('Importing branch '.$branch.' ('.$data['version_normalized'].')');
}