IndexerInfoCommand.php 867 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Indexer\Console\Command;
  7. use Symfony\Component\Console\Input\InputInterface;
  8. use Symfony\Component\Console\Output\OutputInterface;
  9. /**
  10. * Command for displaying information related to indexers.
  11. */
  12. class IndexerInfoCommand extends AbstractIndexerCommand
  13. {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. protected function configure()
  18. {
  19. $this->setName('indexer:info')->setDescription('Shows allowed Indexers');
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. protected function execute(InputInterface $input, OutputInterface $output)
  25. {
  26. $indexers = $this->getAllIndexers();
  27. foreach ($indexers as $indexer) {
  28. $output->writeln(sprintf('%-40s %s', $indexer->getId(), $indexer->getTitle()));
  29. }
  30. }
  31. }