11 use Symfony\Component\Console\Input\ArrayInput;
12 use Symfony\Component\Console\Output\OutputInterface;
22 private $backupRollbackFactory;
41 $this->backupRollbackFactory = $backupRollbackFactory;
54 $rollbackHandler = $this->backupRollbackFactory->create($this->
output);
55 $dbBackupFile = $this->params[
'backup_file_name'];
56 if (!empty($dbBackupFile)) {
58 $rollbackHandler->dbRollback(basename($dbBackupFile));
61 'No available DB backup file found. Please refer to documentation specified ' 62 .
'in <a href=""> doc link </a> to rollback database to a previous version to ',
67 $this->status->toggleUpdateError(
true);
68 throw new \RuntimeException(
69 sprintf(
'Could not complete %s successfully: %s', $this, $e->getMessage()),
81 private function setAreaCode()
83 $areaCode =
'adminhtml';
85 $appState = $this->objectManager->get(\
Magento\Framework\
App\State::class);
86 $appState->setAreaCode($areaCode);
88 $configLoader = $this->objectManager->get(\
Magento\Framework\
ObjectManager\ConfigLoaderInterface::class);
89 $this->objectManager->configure($configLoader->load($areaCode));
output($string, $level=INFO, $label='')
__construct(BackupRollbackFactory $backupRollbackFactory, OutputInterface $output, Status $status, ObjectManagerProvider $objectManagerProvider, $name, $params=[])