Ejemplo n.º 1
0
 /**
  * {@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("");
 }
Ejemplo n.º 2
0
 /**
  * @param  string[] $currencies
  * @return string currency
  */
 protected function askForCurrencyInformation($currencies)
 {
     $this->IOHelper->cls();
     $this->IOHelper->writeln("<info>=== Currency Information ===</info>");
     $question = new ChoiceQuestion("Please select your shop currency", $currencies);
     $question->setErrorMessage('Currency %s is invalid.');
     $currency = $this->IOHelper->ask($question);
     return $currency;
 }