1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

added config option to optimize the autoloader always

This commit is contained in:
Robert Boloc 2014-01-16 20:44:16 +01:00
parent b20021cc6a
commit f67f04adfb
4 changed files with 15 additions and 7 deletions

View file

@ -41,12 +41,6 @@ EOT
protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('optimize')) {
$output->writeln('<info>Generating optimized autoload files</info>');
} else {
$output->writeln('<info>Generating autoload files</info>');
}
$composer = $this->getComposer();
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'dump-autoload', $input, $output);
@ -57,6 +51,14 @@ EOT
$package = $composer->getPackage();
$config = $composer->getConfig();
$composer->getAutoloadGenerator()->dump($config, $localRepo, $package, $installationManager, 'composer', $input->getOption('optimize'));
$optimize = $input->getOption('optimize') || $config->get('autoloader-optimize-always');
if ($optimize) {
$output->writeln('<info>Generating optimized autoload files</info>');
} else {
$output->writeln('<info>Generating autoload files</info>');
}
$composer->getAutoloadGenerator()->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
}
}