/** * Index Action * * @return JsonModel * @SuppressWarnings(PHPMD.NPathComplexity) */ public function startAction() { $this->log->clear(); $json = new JsonModel; try { $data = array_merge( $this->importDeploymentConfigForm(), $this->importUserConfigForm(), $this->importAdminUserForm() ); $this->installer->install($data); $json->setVariable( 'key', $this->installer->getInstallInfo()[SetupConfigOptionsList::KEY_ENCRYPTION_KEY] ); $json->setVariable('success', true); $json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]); } catch (\Exception $e) { $this->log->logError($e); $json->setVariable('success', false); if ($e instanceof \Magento\Setup\SampleDataException) { $json->setVariable('isSampleDataError', true); } } return $json; }
/** * Index Action * * @return JsonModel */ public function startAction() { $this->log->clear(); $json = new JsonModel(); try { $data = array_merge($this->importDeploymentConfigForm(), $this->importUserConfigForm(), $this->importAdminUserForm()); $this->installer->install($data); $json->setVariable('key', $this->installer->getInstallInfo()[EncryptConfig::KEY_ENCRYPTION_KEY]); $json->setVariable('success', true); $json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]); } catch (\Exception $e) { $this->log->logError($e); $json->setVariable('success', false); } return $json; }
/** * Index Action * * @return JsonModel */ public function startAction() { $this->log->clear(); $json = new JsonModel(); try { $this->checkForPriorInstall(); $content = $this->getRequest()->getContent(); $source = $content ? $source = Json::decode($content, Json::TYPE_ARRAY) : []; $data = $this->requestDataConverter->convert($source); $this->installer->install($data); $json->setVariable('key', $this->installer->getInstallInfo()[SetupConfigOptionsList::KEY_ENCRYPTION_KEY]); $json->setVariable('success', true); if ($this->sampleDataState->hasError()) { $json->setVariable('isSampleDataError', true); } $json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]); } catch (\Exception $e) { $this->log->logError($e); $json->setVariable('messages', $e->getMessage()); $json->setVariable('success', false); } return $json; }
public function testClearNotExist() { $this->directoryWriteMock->expects($this->never())->method('delete'); $this->webLogger->clear(); }