mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Implement writeError throughout Composer
This commit is contained in:
parent
84d4594278
commit
cb336a5416
65 changed files with 390 additions and 322 deletions
|
@ -127,14 +127,14 @@ class VcsRepository extends ArrayRepository
|
|||
}
|
||||
} catch (\Exception $e) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<error>Skipped parsing '.$driver->getRootIdentifier().', '.$e->getMessage().'</error>');
|
||||
$this->io->writeError('<error>Skipped parsing '.$driver->getRootIdentifier().', '.$e->getMessage().'</error>');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($driver->getTags() as $tag => $identifier) {
|
||||
$msg = 'Reading composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $tag . '</comment>)';
|
||||
if ($verbose) {
|
||||
$this->io->write($msg);
|
||||
$this->io->writeError($msg);
|
||||
} else {
|
||||
$this->io->overwrite($msg, false);
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ class VcsRepository extends ArrayRepository
|
|||
|
||||
if (!$parsedTag = $this->validateTag($tag)) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped tag '.$tag.', invalid tag name</warning>');
|
||||
$this->io->writeError('<warning>Skipped tag '.$tag.', invalid tag name</warning>');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ class VcsRepository extends ArrayRepository
|
|||
try {
|
||||
if (!$data = $driver->getComposerInformation($identifier)) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped tag '.$tag.', no composer file</warning>');
|
||||
$this->io->writeError('<warning>Skipped tag '.$tag.', no composer file</warning>');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -173,19 +173,19 @@ class VcsRepository extends ArrayRepository
|
|||
// broken package, version doesn't match tag
|
||||
if ($data['version_normalized'] !== $parsedTag) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped tag '.$tag.', tag ('.$parsedTag.') does not match version ('.$data['version_normalized'].') in composer.json</warning>');
|
||||
$this->io->writeError('<warning>Skipped tag '.$tag.', tag ('.$parsedTag.') does not match version ('.$data['version_normalized'].') in composer.json</warning>');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($verbose) {
|
||||
$this->io->write('Importing tag '.$tag.' ('.$data['version_normalized'].')');
|
||||
$this->io->writeError('Importing tag '.$tag.' ('.$data['version_normalized'].')');
|
||||
}
|
||||
|
||||
$this->addPackage($this->loader->load($this->preProcess($driver, $data, $identifier)));
|
||||
} catch (\Exception $e) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()).'</warning>');
|
||||
$this->io->writeError('<warning>Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()).'</warning>');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -198,14 +198,14 @@ class VcsRepository extends ArrayRepository
|
|||
foreach ($driver->getBranches() as $branch => $identifier) {
|
||||
$msg = 'Reading composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $branch . '</comment>)';
|
||||
if ($verbose) {
|
||||
$this->io->write($msg);
|
||||
$this->io->writeError($msg);
|
||||
} else {
|
||||
$this->io->overwrite($msg, false);
|
||||
}
|
||||
|
||||
if (!$parsedBranch = $this->validateBranch($branch)) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped branch '.$branch.', invalid name</warning>');
|
||||
$this->io->writeError('<warning>Skipped branch '.$branch.', invalid name</warning>');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ class VcsRepository extends ArrayRepository
|
|||
try {
|
||||
if (!$data = $driver->getComposerInformation($identifier)) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped branch '.$branch.', no composer file</warning>');
|
||||
$this->io->writeError('<warning>Skipped branch '.$branch.', no composer file</warning>');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ class VcsRepository extends ArrayRepository
|
|||
}
|
||||
|
||||
if ($verbose) {
|
||||
$this->io->write('Importing branch '.$branch.' ('.$data['version'].')');
|
||||
$this->io->writeError('Importing branch '.$branch.' ('.$data['version'].')');
|
||||
}
|
||||
|
||||
$packageData = $this->preProcess($driver, $data, $identifier);
|
||||
|
@ -241,16 +241,16 @@ class VcsRepository extends ArrayRepository
|
|||
$this->addPackage($package);
|
||||
} catch (TransportException $e) {
|
||||
if ($verbose) {
|
||||
$this->io->write('<warning>Skipped branch '.$branch.', no composer file was found</warning>');
|
||||
$this->io->writeError('<warning>Skipped branch '.$branch.', no composer file was found</warning>');
|
||||
}
|
||||
continue;
|
||||
} catch (\Exception $e) {
|
||||
if (!$verbose) {
|
||||
$this->io->write('');
|
||||
$this->io->writeError('');
|
||||
}
|
||||
$this->branchErrorOccurred = true;
|
||||
$this->io->write('<error>Skipped branch '.$branch.', '.$e->getMessage().'</error>');
|
||||
$this->io->write('');
|
||||
$this->io->writeError('<error>Skipped branch '.$branch.', '.$e->getMessage().'</error>');
|
||||
$this->io->writeError('');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue