Skip to content
Browse files

Add --optimize flag to dump-autoload that allows turning PSR0 into cl…

…assmaps
  • Loading branch information...
1 parent 44d7d4a commit 2edb26db6515f9030e697c361cf5204bf2bb4eca @Seldaek Seldaek committed Aug 14, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Composer/Command/DumpAutoloadCommand.php
View
6 src/Composer/Command/DumpAutoloadCommand.php
@@ -13,6 +13,7 @@
namespace Composer\Command;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Composer\Repository\CompositeRepository;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Autoload\AutoloadGenerator;
@@ -27,6 +28,9 @@ protected function configure()
$this
->setName('dump-autoload')
->setDescription('dumps the autoloader')
+ ->setDefinition(array(
+ new InputOption('optimize', 'o', InputOption::VALUE_NONE, 'Optimizes PSR0 packages to be loaded with classmaps too, good for production.'),
+ ))
->setHelp(<<<EOT
<info>php composer.phar dump-autoload</info>
EOT
@@ -45,6 +49,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
$config = $composer->getConfig();
$generator = new AutoloadGenerator();
- $generator->dump($config, $localRepos, $package, $installationManager, 'composer');
+ $generator->dump($config, $localRepos, $package, $installationManager, 'composer', $input->getOption('optimize'));
}
}

0 comments on commit 2edb26d

Please sign in to comment.
Something went wrong with that request. Please try again.