AbstractCacheCommand.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 Magento\Framework\App\Cache\Manager;
  8. use Symfony\Component\Console\Command\Command;
  9. use Symfony\Component\Console\Input\InputOption;
  10. /**
  11. * Abstract cache command
  12. *
  13. * @api
  14. * @since 100.0.2
  15. */
  16. abstract class AbstractCacheCommand extends Command
  17. {
  18. /**
  19. * Input option bootstrap
  20. */
  21. const INPUT_KEY_BOOTSTRAP = 'bootstrap';
  22. /**
  23. * CacheManager
  24. *
  25. * @var Manager
  26. */
  27. protected $cacheManager;
  28. /**
  29. * Constructor
  30. *
  31. * @param Manager $cacheManager
  32. */
  33. public function __construct(Manager $cacheManager)
  34. {
  35. $this->cacheManager = $cacheManager;
  36. parent::__construct();
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. protected function configure()
  42. {
  43. $this->addOption(
  44. self::INPUT_KEY_BOOTSTRAP,
  45. null,
  46. InputOption::VALUE_REQUIRED,
  47. 'add or override parameters of the bootstrap'
  48. );
  49. }
  50. }