1
0
Fork 0

Merge pull request #7590 from staabm/dump-nbclasses

Print number of classes contained within the generated classmap
pull/7623/head
Jordi Boggiano 2018-09-05 00:24:10 +02:00 committed by GitHub
commit 987bd5dd7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -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())

View File

@ -61,11 +61,11 @@ EOT
$apcu = $input->getOption('apcu') || $config->get('apcu-autoloader');
if ($authoritative) {
$this->getIO()->writeError('<info>Generating optimized autoload files (authoritative)</info>');
$this->getIO()->writeError('<info>Generating optimized autoload files (authoritative)</info>', false);
} elseif ($optimize) {
$this->getIO()->writeError('<info>Generating optimized autoload files</info>');
$this->getIO()->writeError('<info>Generating optimized autoload files</info>', false);
} else {
$this->getIO()->writeError('<info>Generating autoload files</info>');
$this->getIO()->writeError('<info>Generating autoload files</info>', 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('<info>Generated optimized autoload files (authoritative) containing '. $numberOfClasses .' classes</info>');
} elseif ($optimize) {
$this->getIO()->overwriteError('<info>Generated optimized autoload files containing '. $numberOfClasses .' classes</info>');
} else {
$this->getIO()->overwriteError('<info>Generated autoload files containing '. $numberOfClasses .' classes</info>');
}
}
}