1
0
Fork 0

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

pull/1000/head
Jordi Boggiano 2012-08-14 20:29:29 +02:00
parent 44d7d4a38e
commit 2edb26db65
1 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@
namespace Composer\Command; namespace Composer\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Composer\Repository\CompositeRepository; use Composer\Repository\CompositeRepository;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Composer\Autoload\AutoloadGenerator; use Composer\Autoload\AutoloadGenerator;
@ -27,6 +28,9 @@ class DumpAutoloadCommand extends Command
$this $this
->setName('dump-autoload') ->setName('dump-autoload')
->setDescription('dumps the autoloader') ->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 ->setHelp(<<<EOT
<info>php composer.phar dump-autoload</info> <info>php composer.phar dump-autoload</info>
EOT EOT
@ -45,6 +49,6 @@ EOT
$config = $composer->getConfig(); $config = $composer->getConfig();
$generator = new AutoloadGenerator(); $generator = new AutoloadGenerator();
$generator->dump($config, $localRepos, $package, $installationManager, 'composer'); $generator->dump($config, $localRepos, $package, $installationManager, 'composer', $input->getOption('optimize'));
} }
} }