Esempio 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("");
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->input = $input;
     $this->output = $output;
     $this->container = $this->getApplication()->getContainer();
     if (!is_dir(UPDATE_FILES_PATH) && !is_dir(UPDATE_ASSET_PATH)) {
         $this->output->writeln("No update files found.");
         return 1;
     }
     $this->container->setParameter('update.config', array());
     $this->unpackFiles();
     $this->migrateDatabase();
     $this->importSnippets();
     $this->cleanup();
 }
Esempio n. 3
0
$container = new Container(new Pimple(), $config);
/** @var \Slim\Slim $app */
$app = $container->get('app');
$app->hook('slim.before.dispatch', function () use($app, $container) {
    $baseUrl = \Shopware\Recovery\Common\Utils::getBaseUrl($app);
    $lang = null;
    if (!UPDATE_IS_MANUAL) {
        if (!is_file(UPDATE_META_FILE)) {
            $shopPath = str_replace('/recovery/update', '/', $app->request()->getRootUri());
            $app->response()->redirect($shopPath);
            $app->response()->status(302);
            $app->stop();
        }
        $file = file_get_contents(UPDATE_META_FILE);
        $updateConfig = json_decode($file, true);
        $container->setParameter('update.config', $updateConfig);
        $lang = substr($updateConfig['locale'], 0, 2);
    }
    session_set_cookie_params(7200, $baseUrl);
    //Silence errors during session start, Work around session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)
    @session_start();
    @set_time_limit(0);
    $selectedLanguage = Utils::getLanguage($app->request, $lang);
    $language = (require __DIR__ . "/../data/lang/{$selectedLanguage}.php");
    $clientIp = Utils::getRealIpAddr();
    $app->view()->set('app', $app);
    $app->view()->set('clientIp', $clientIp);
    $app->view()->set('baseUrl', $baseUrl);
    $app->view()->set('language', $language);
    $app->view()->set('selectedLanguage', $selectedLanguage);
    $ipCheckEnabled = (bool) $app->config('check.ip');