/** * Update system settings such as app url, company name and short name */ protected function updateSystemSettings() { /** @var ConfigManager $configManager */ $configManager = $this->getContainer()->get('oro_config.global'); $options = ['application-url' => ['label' => 'Application URL', 'config_key' => 'oro_ui.application_url', 'askMethod' => 'ask', 'additionalAskArguments' => []]]; foreach ($options as $optionName => $optionData) { $configKey = $optionData['config_key']; $defaultValue = $configManager->get('diamante_distribution.application_url'); $value = $this->inputOptionProvider->get($optionName, $optionData['label'], $defaultValue, $optionData['askMethod'], $optionData['additionalAskArguments']); // update setting if it's not empty and not equal to default value if (!empty($value) && $value !== $defaultValue) { $configManager->set($configKey, $value); } } $configManager->flush(); }
/** * @param CommandExecutor $commandExecutor * @param OutputInterface $output * * @return InstallCommand */ protected function loadDataStep(CommandExecutor $commandExecutor, OutputInterface $output) { $output->writeln('<info>Setting up database.</info>'); $commandExecutor->runCommand('oro:migration:load', ['--force' => true, '--process-isolation' => true, '--timeout' => $commandExecutor->getDefaultTimeout()])->runCommand('oro:workflow:definitions:load', ['--process-isolation' => true])->runCommand('oro:process:configuration:load', ['--process-isolation' => true])->runCommand('oro:migration:data:load', ['--process-isolation' => true, '--no-interaction' => true]); $output->writeln(''); $output->writeln('<info>Administration setup.</info>'); $this->updateSystemSettings(); $this->updateOrganization($commandExecutor); $this->updateUser($commandExecutor); $isDemo = $this->inputOptionProvider->get('sample-data', 'Load sample data (y/n)', false, 'askConfirmation', [false]); if ($isDemo) { // load demo fixtures $commandExecutor->runCommand('oro:migration:data:load', array('--process-isolation' => true, '--fixtures-type' => 'demo')); } $output->writeln(''); return $this; }