6 declare(strict_types=1);
13 use Symfony\Component\Console\Command\Command;
14 use Symfony\Component\Console\Input\InputInterface;
15 use Symfony\Component\Console\Input\InputOption;
16 use Symfony\Component\Console\Output\OutputInterface;
33 private $whitelistGenerator;
43 $this->whitelistGenerator = $whitelistGenerator;
44 parent::__construct(
$name);
54 $this->setName(
'setup:db-declaration:generate-whitelist')
56 'Generate whitelist of tables and columns that are allowed to be edited by declaration installer' 61 self::MODULE_NAME_KEY,
63 InputOption::VALUE_OPTIONAL,
64 'Name of the module where whitelist will be generated',
75 protected function execute(InputInterface $input, OutputInterface
$output) : int
77 $moduleName = $input->getOption(self::MODULE_NAME_KEY);
80 $this->whitelistGenerator->generate($moduleName);
82 $output->writeln($e->getMessage());
83 return \Magento\Framework\Console\Cli::RETURN_FAILURE;
84 }
catch (\Exception $e) {
85 return \Magento\Framework\Console\Cli::RETURN_FAILURE;
88 return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
execute(InputInterface $input, OutputInterface $output)
__construct(WhitelistGenerator $whitelistGenerator, $name=null)
if(!isset($_GET['name'])) $name