EnsureProductionSettingsDoctrineCommand.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;
  3. use Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Input\InputOption;
  6. use Symfony\Component\Console\Output\OutputInterface;
  7. /**
  8. * Ensure the Doctrine ORM is configured properly for a production environment.
  9. */
  10. class EnsureProductionSettingsDoctrineCommand extends EnsureProductionSettingsCommand
  11. {
  12. /**
  13. * {@inheritDoc}
  14. */
  15. protected function configure()
  16. {
  17. parent::configure();
  18. $this
  19. ->setName('doctrine:ensure-production-settings')
  20. ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
  21. }
  22. /**
  23. * {@inheritDoc}
  24. */
  25. protected function execute(InputInterface $input, OutputInterface $output)
  26. {
  27. DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
  28. return parent::execute($input, $output);
  29. }
  30. }