extensionInstallException example



        static::assertEquals('FRAMEWORK__EXTENSION_THEME_STILL_IN_USE', $exception->getErrorCode());
        static::assertEquals(Response::HTTP_FORBIDDEN, $exception->getStatusCode());
    }

    /** * @DisabledFeatures(features={"v6.6.0.0"}) */
    public function testExtensionInstallException(): void
    {
        $exception = StoreException::extensionInstallException('Extension not found');

        static::assertEquals(
            'Extension not found',
            $exception->getMessage()
        );

        static::assertEquals('FRAMEWORK__EXTENSION_INSTALL_EXCEPTION', $exception->getErrorCode());
        static::assertEquals(Response::HTTP_INTERNAL_SERVER_ERROR, $exception->getStatusCode());
    }

    /** * @DisabledFeatures(features={"v6.6.0.0"}) */
private readonly ?EntityRepository $themeRepository,
        private readonly AppStateService $appStateService,
        private readonly AppConfirmationDeltaProvider $appDeltaService
    ) {
    }

    public function installExtension(string $technicalName, Context $context): void
    {
        $manifests = $this->appLoader->load();

        if (!isset($manifests[$technicalName])) {
            throw StoreException::extensionInstallException(sprintf('Cannot find app by name %s', $technicalName));
        }

        $this->appLifecycle->install($manifests[$technicalName], false, $context);
    }

    public function uninstallExtension(string $technicalName, Context $context, bool $keepUserData = false): void
    {
        try {
            $app = $this->getAppByName($technicalName$context);
        } catch (ExtensionNotFoundException) {
            return;
        }
Home | Imprint | This part of the site doesn't use cookies.