command = $command; parent::__construct($output, $status, $objectManagerProvider, $name, $params); } /** * Execute set cache command * * @return void */ public function execute() { try { $arguments = []; if ($this->getName() === 'setup:cache:enable') { if (!empty($this->params)) { $arguments[AbstractCacheManageCommand::INPUT_KEY_TYPES] = explode(' ', $this->params[0]); } $arguments['command'] = 'cache:enable'; $inputDefinition = []; if ($this->command->getDefinition()->hasArgument('command')) { $inputDefinition[] = new InputArgument('command', InputArgument::REQUIRED); } if ($this->command->getDefinition()->hasArgument(AbstractCacheManageCommand::INPUT_KEY_TYPES)) { $inputDefinition[] = new InputArgument( AbstractCacheManageCommand::INPUT_KEY_TYPES, InputArgument::REQUIRED ); } if (!empty($inputDefinition)) { $definition = new InputDefinition($inputDefinition); $this->command->setDefinition($definition); } } else { $arguments['command'] = 'cache:disable'; } $this->command->run(new ArrayInput($arguments), $this->output); } catch (\Exception $e) { $this->status->toggleUpdateError(true); throw new \RuntimeException(sprintf('Could not complete %s successfully: %s', $this, $e->getMessage())); } } }