runMigrations example

$oldVersion = $systemConfigService->getString(UpdateController::UPDATE_PREVIOUS_VERSION_KEY);

            $newVersion = $containerWithoutPlugins->getParameter('kernel.shopware_version');
            if (!\is_string($newVersion)) {
                throw new \RuntimeException('Container parameter "kernel.shopware_version" needs to be a string');
            }

            /** @var EventDispatcherInterface $eventDispatcherWithoutPlugins */
            $eventDispatcherWithoutPlugins = $this->rebootKernelWithoutPlugins()->get('event_dispatcher');
            $eventDispatcherWithoutPlugins->dispatch(new UpdatePreFinishEvent($context$oldVersion$newVersion));

            $this->runMigrations($output);
        } finally {
            $kernel->reboot(null, $pluginLoader);
        }

        if ($input->getOption('skip-asset-build')) {
            $context->addState(PluginLifecycleService::STATE_SKIP_ASSET_BUILDING);
        }

        /** @var EventDispatcherInterface $eventDispatcher */
        $eventDispatcher = $this->container->get('event_dispatcher');
        $updateEvent = new UpdatePostFinishEvent($context$oldVersion$newVersion);
        
$plugin->setUpgradedAt($upgradeDate);
            }

            $this->eventDispatcher->dispatch(new PluginPreInstallEvent($plugin$installContext));

            $this->systemConfigService->savePluginConfiguration($pluginBaseClass, true);

            $pluginBaseClass->install($installContext);

            $this->customEntityLifecycleService->updatePlugin($plugin->getId()$plugin->getPath() ?? '');

            $this->runMigrations($installContext);

            $installDate = new \DateTime();
            $pluginData['installedAt'] = $installDate->format(Defaults::STORAGE_DATE_TIME_FORMAT);
            $plugin->setInstalledAt($installDate);

            $this->updatePluginData($pluginData$shopwareContext);

            $pluginBaseClass->postInstall($installContext);

            $this->eventDispatcher->dispatch(new PluginPostInstallEvent($plugin$installContext));
        } catch (\Throwable $e) {
            
Home | Imprint | This part of the site doesn't use cookies.