/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $this->container = $this->getApplication()->getContainer(); $this->container->setParameter('update.config', []); $this->IOHelper = $ioService = new IOHelper($input, $output, $this->getHelper('question')); if (!is_dir(UPDATE_FILES_PATH) && !is_dir(UPDATE_ASSET_PATH)) { $ioService->writeln("No update files found."); return 1; } $version = $this->container->get('shopware.version'); if ($ioService->isInteractive()) { $ioService->cls(); $ioService->printBanner(); $ioService->writeln("<info>Welcome to the Shopware updater </info>"); $ioService->writeln(sprintf("Shopware Version %s", $version)); $ioService->writeln(""); $ioService->ask('Press return to start the update.'); $ioService->cls(); } $this->unpackFiles(); $this->migrateDatabase(); $this->importSnippets(); $this->cleanup(); $this->synchronizeThemes(); $this->writeLockFile(); $ioService->cls(); $ioService->writeln(""); $ioService->writeln(""); $ioService->writeln("<info>The update has been finished succesfuly.</info>"); $ioService->writeln("Your shop is currently in maintenance mode."); $ioService->writeln(sprintf("Please delete <question>%s</question> to finish the update.", UPDATE_ASSET_PATH)); $ioService->writeln(""); }
/** * Facade for asking questions * * @param Question $question * @return string */ public function askQuestion(Question $question) { return $this->IOHelper->ask($question); }
/** * @return bool */ protected function shouldSkipImport() { $question = new ConfirmationQuestion('The database already contains shopware tables. Skip import? (yes/no) [yes]', true); $skipImport = $this->IOHelper->ask($question); return (bool) $skipImport; }