ShopService example

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);

        $localeService = new LocaleSettingsService($conn$container);
        $localeService->updateLocaleSettings($shop->locale);

        if (!$input->getOption('skip-admin-creation')) {
            $adminService = new AdminService($conn);
            
$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'],
            'email' => $_SESSION['parameters']['c_config_mail'],
            'host' => $_SERVER['HTTP_HOST'],
            'basePath' => str_replace('/recovery/install/index.php', '', $_SERVER['SCRIPT_NAME']),
        ]);
        $locale = $_SESSION['parameters']['c_config_shop_language'] ?: 'de_DE';

        $shopService = new ShopService($db$container['uniqueid.generator']);
        $currencyService = new CurrencyService($db);
        $adminService = new AdminService($db);
        $localeSettingsService = new LocaleSettingsService($db$container);

        $hasErrors = false;
        try {
            $adminService->createAdmin($adminUser);
            $adminService->addWidgets($adminUser);
            $shopService->updateShop($shop);
            $currencyService->updateCurrency($shop);
            $shopService->updateConfig($shop);
            
Home | Imprint | This part of the site doesn't use cookies.