installFactory = $installFactory; $this->deploymentConfig = $deploymentConfig; parent::__construct(); } /** * Initialization of the command * * @return void */ protected function configure() { $this->setName('setup:db-data:upgrade')->setDescription('Installs and upgrades data in the DB'); parent::configure(); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->deploymentConfig->isAvailable()) { $output->writeln("No information is available: the Magento application is not installed."); // we must have an exit code higher than zero to indicate something was wrong return \Magento\Framework\Console\Cli::RETURN_FAILURE; } $installer = $this->installFactory->create(new ConsoleLogger($output)); $installer->installDataFixtures(); return \Magento\Framework\Console\Cli::RETURN_SUCCESS; } }