diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index d54f3d6f6..0db4015c3 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -312,6 +312,8 @@ EOF; 'optimize' => (bool) $scanPsr0Packages, )); } + + return count($classMap); } private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, array $classMap = array()) diff --git a/src/Composer/Command/DumpAutoloadCommand.php b/src/Composer/Command/DumpAutoloadCommand.php index fe80e3760..c255e149f 100644 --- a/src/Composer/Command/DumpAutoloadCommand.php +++ b/src/Composer/Command/DumpAutoloadCommand.php @@ -61,11 +61,11 @@ EOT $apcu = $input->getOption('apcu') || $config->get('apcu-autoloader'); if ($authoritative) { - $this->getIO()->writeError('Generating optimized autoload files (authoritative)'); + $this->getIO()->writeError('Generating optimized autoload files (authoritative)', false); } elseif ($optimize) { - $this->getIO()->writeError('Generating optimized autoload files'); + $this->getIO()->writeError('Generating optimized autoload files', false); } else { - $this->getIO()->writeError('Generating autoload files'); + $this->getIO()->writeError('Generating autoload files', false); } $generator = $composer->getAutoloadGenerator(); @@ -73,6 +73,14 @@ EOT $generator->setClassMapAuthoritative($authoritative); $generator->setApcu($apcu); $generator->setRunScripts(!$input->getOption('no-scripts')); - $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize); + $numberOfClasses = $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize); + + if ($authoritative) { + $this->getIO()->overwriteError('Generating optimized autoload files (authoritative) containing '. $numberOfClasses .' classes'); + } elseif ($optimize) { + $this->getIO()->overwriteError('Generating optimized autoload files containing '. $numberOfClasses .' classes'); + } else { + $this->getIO()->overwriteError('Generating autoload files containing '. $numberOfClasses .' classes'); + } } }