CacheStatusCommand.php 922 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Console\Command;
  7. use Symfony\Component\Console\Input\InputInterface;
  8. use Symfony\Component\Console\Output\OutputInterface;
  9. /**
  10. * Command for checking cache status
  11. *
  12. * @api
  13. * @since 100.0.2
  14. */
  15. class CacheStatusCommand extends AbstractCacheCommand
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. protected function configure()
  21. {
  22. $this->setName('cache:status');
  23. $this->setDescription('Checks cache status');
  24. parent::configure();
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. protected function execute(InputInterface $input, OutputInterface $output)
  30. {
  31. $output->writeln('Current status:');
  32. foreach ($this->cacheManager->getStatus() as $cache => $status) {
  33. $output->writeln(sprintf('%30s: %d', $cache, $status));
  34. }
  35. }
  36. }