1
0
Fork 0

Merge remote-tracking branch 'fabpot/more-debug'

pull/5846/head
Jordi Boggiano 2016-11-06 18:18:52 +01:00
commit 8ad6385ffb
7 changed files with 38 additions and 0 deletions

View File

@ -496,6 +496,38 @@ class Installer
$devPackages = null; $devPackages = null;
} }
if ($operations) {
$installs = $updates = $uninstalls = array();
foreach ($operations as $operation) {
if ($operation instanceof InstallOperation) {
$installs[] = $operation->getPackage()->getPrettyName().':'.$operation->getPackage()->getFullPrettyVersion();
} elseif ($operation instanceof UpdateOperation) {
$updates[] = $operation->getTargetPackage()->getPrettyName().':'.$operation->getTargetPackage()->getFullPrettyVersion();
} elseif ($operation instanceof UninstallOperation) {
$uninstalls[] = $operation->getPackage()->getPrettyName();
}
}
$this->io->writeError(
sprintf("<info>Package operations: %d install%s, %d update%s, %d removal%s</info>",
count($installs),
1 === count($installs) ? '' : 's',
count($updates),
1 === count($updates) ? '' : 's',
count($uninstalls),
1 === count($uninstalls) ? '' : 's')
);
if ($installs) {
$this->io->writeError("Installs: ".implode(', ', $installs), true, IOInterface::VERBOSE);
}
if ($updates) {
$this->io->writeError("Updates: ".implode(', ', $updates), true, IOInterface::VERBOSE);
}
if ($uninstalls) {
$this->io->writeError("Removals: ".implode(', ', $uninstalls), true, IOInterface::VERBOSE);
}
}
foreach ($operations as $operation) { foreach ($operations as $operation) {
// collect suggestions // collect suggestions
if ('install' === $operation->getJobType()) { if ('install' === $operation->getJobType()) {

View File

@ -26,6 +26,7 @@ install
--EXPECT-OUTPUT-- --EXPECT-OUTPUT--
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies (including require-dev) Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
<warning>Package a/a is abandoned, you should avoid using it. No replacement was suggested.</warning> <warning>Package a/a is abandoned, you should avoid using it. No replacement was suggested.</warning>
<warning>Package c/c is abandoned, you should avoid using it. Use b/b instead.</warning> <warning>Package c/c is abandoned, you should avoid using it. Use b/b instead.</warning>
Writing lock file Writing lock file

View File

@ -36,6 +36,7 @@ update a b --with-dependencies
--EXPECT-OUTPUT-- --EXPECT-OUTPUT--
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies (including require-dev) Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
Writing lock file Writing lock file
Generating autoload files Generating autoload files

View File

@ -21,6 +21,7 @@ install
--EXPECT-OUTPUT-- --EXPECT-OUTPUT--
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies (including require-dev) Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
Writing lock file Writing lock file
Generating autoload files Generating autoload files

View File

@ -19,6 +19,7 @@ install --no-dev
--EXPECT-OUTPUT-- --EXPECT-OUTPUT--
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies Updating dependencies
Package operations: 1 install, 0 updates, 0 removals
Writing lock file Writing lock file
Generating autoload files Generating autoload files

View File

@ -21,6 +21,7 @@ install
--EXPECT-OUTPUT-- --EXPECT-OUTPUT--
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies (including require-dev) Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
Writing lock file Writing lock file
Generating autoload files Generating autoload files

View File

@ -19,6 +19,7 @@ install
--EXPECT-OUTPUT-- --EXPECT-OUTPUT--
Loading composer repositories with package information Loading composer repositories with package information
Updating dependencies (including require-dev) Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
a/a suggests installing b/b (an obscure reason) a/a suggests installing b/b (an obscure reason)
Writing lock file Writing lock file
Generating autoload files Generating autoload files