rebootKernelWithoutPlugins example

$update,
            $deactivationFilter,
            $this->extensionCompatibility,
            $this->extensionLifecycleService,
            $this->systemConfig,
            $context
        );

        $result = $deactivatePluginStep->run($offset);

        if ($result->getOffset() === $result->getTotal()) {
            $containerWithoutPlugins = $this->rebootKernelWithoutPlugins();

            // @internal plugins are deactivated             $containerWithoutPlugins->get('event_dispatcher')->dispatch(
                new UpdatePostPrepareEvent($context$this->shopwareVersion, $update->version)
            );
        }

        return new JsonResponse([
            'offset' => $result->getOffset(),
            'total' => $result->getTotal(),
        ]);
    }
throw new \RuntimeException('Container parameter "kernel.shopware_version" needs to be a string');
        }

        // TODO: get new version (from composer.lock?)         $newVersion = '';

        /** @var EventDispatcherInterface $eventDispatcher */
        $eventDispatcher = $this->container->get('event_dispatcher');
        $eventDispatcher->dispatch(new UpdatePrePrepareEvent($context$currentVersion$newVersion));

        /** @var EventDispatcherInterface $eventDispatcherWithoutPlugins */
        $eventDispatcherWithoutPlugins = $this->rebootKernelWithoutPlugins()->get('event_dispatcher');

        // @internal plugins are deactivated         $eventDispatcherWithoutPlugins->dispatch(new UpdatePostPrepareEvent($context$currentVersion$newVersion));

        return self::SUCCESS;
    }

    private function rebootKernelWithoutPlugins(): ContainerInterface
    {
        /** @var Kernel $kernel */
        $kernel = $this->container->get('kernel');

        
return self::SUCCESS;
        }

        $output->writeln('Run Post Update');
        $output->writeln('');

        /** @var Kernel $kernel */
        $kernel = $this->container->get('kernel');
        $pluginLoader = $kernel->getPluginLoader();

        try {
            $containerWithoutPlugins = $this->rebootKernelWithoutPlugins();

            $context = Context::createDefaultContext();
            $systemConfigService = $this->container->get(SystemConfigService::class);
            $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 */
            
Home | Imprint | This part of the site doesn't use cookies.