Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigImportCommand.php
Go to the documentation of this file.
1 <?php
7 
9 use Symfony\Component\Console\Command\Command;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
14 
22 class ConfigImportCommand extends Command
23 {
27  const COMMAND_NAME = 'app:config:import';
28 
34  private $processor;
35 
39  public function __construct(Processor $processor)
40  {
41  $this->processor = $processor;
42 
43  parent::__construct();
44  }
45 
49  protected function configure()
50  {
51  $this->setName(self::COMMAND_NAME)
52  ->setDescription('Import data from shared configuration files to appropriate data storage');
53 
54  parent::configure();
55  }
56 
60  protected function execute(InputInterface $input, OutputInterface $output)
61  {
62  try {
63  $this->processor->execute($input, $output);
64  } catch (RuntimeException $e) {
65  $output->writeln('<error>' . $e->getMessage() . '</error>');
66 
67  return Cli::RETURN_FAILURE;
68  }
69 
70  return Cli::RETURN_SUCCESS;
71  }
72 }
$processor
Definition: 404.php:10
execute(InputInterface $input, OutputInterface $output)