CacheCleanCommand.php 913 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /**
  8. * Command for cleaning cache
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class CacheCleanCommand extends AbstractCacheTypeManageCommand
  14. {
  15. /**
  16. * {@inheritdoc}
  17. */
  18. protected function configure()
  19. {
  20. $this->setName('cache:clean');
  21. $this->setDescription('Cleans cache type(s)');
  22. parent::configure();
  23. }
  24. /**
  25. * Cleans cache types
  26. *
  27. * @param array $cacheTypes
  28. * @return void
  29. */
  30. protected function performAction(array $cacheTypes)
  31. {
  32. $this->eventManager->dispatch('adminhtml_cache_flush_system');
  33. $this->cacheManager->clean($cacheTypes);
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. protected function getDisplayMessage()
  39. {
  40. return 'Cleaned cache types:';
  41. }
  42. }