AdminUser example

try {
        $db = $container->offsetGet('db');
    } catch (\Exception $e) {
        $menuHelper->setCurrent('database-configuration');
        $app->render('database-configuration.php', ['error' => 'Please fill in all fields']);

        return;
    }

    if ($app->request()->isPost()) {
        $adminUser = new \Shopware\Recovery\Install\Struct\AdminUser([
            'email' => $_SESSION['parameters']['c_config_admin_email'],
            'username' => $_SESSION['parameters']['c_config_admin_username'],
            'name' => $_SESSION['parameters']['c_config_admin_name'],
            'password' => $_SESSION['parameters']['c_config_admin_password'],
            'locale' => localeForLanguage($_SESSION['language']),
        ]);

        $shop = new \Shopware\Recovery\Install\Struct\Shop([
            'name' => $_SESSION['parameters']['c_config_shopName'],
            'locale' => $_SESSION['parameters']['c_config_shop_language'],
            'currency' => $_SESSION['parameters']['c_config_shop_currency'],
            
$shop = new Shop();
        $shop = $this->getShopInfoFromArgs($input$shop);
        $shop = $this->getShopInfoFromInteractiveShell($shop);

        if ($this->IOHelper->isInteractive() && !$this->webserverCheck($container$shop)) {
            $this->IOHelper->writeln('Could not verify');
            if (!$this->IOHelper->askConfirmation('Continue?')) {
                return 1;
            }
        }

        $adminUser = new AdminUser();
        if (!$input->getOption('skip-admin-creation')) {
            $adminUser = $this->getAdminInfoFromArgs($input$adminUser);
            $adminUser = $this->getAdminInfoFromInteractiveShell($adminUser);
        }

        $shopService = new ShopService($conn$container['uniqueid.generator']);
        $shopService->updateShop($shop);
        $shopService->updateConfig($shop);

        $currencyService = new CurrencyService($conn);
        $currencyService->updateCurrency($shop);

        
Home | Imprint | This part of the site doesn't use cookies.