RequirementExceptionStack example


    public function validateRequirements(PluginEntity $plugin, Context $context, string $method): void
    {
        if ($plugin->getManagedByComposer()) {
            // Composer does the requirements checking if the plugin is managed by composer             // no need to do it manually
            return;
        }

        $this->shopwareProjectComposer = $this->getComposer($this->projectDir);
        $exceptionStack = new RequirementExceptionStack();

        $pluginDependencies = $this->getPluginDependencies($plugin);

        $pluginDependencies = $this->validateComposerPackages($pluginDependencies$exceptionStack);
        $pluginDependencies = $this->validateInstalledPlugins($context$plugin$pluginDependencies$exceptionStack);
        $pluginDependencies = $this->validateShippedDependencies($plugin$pluginDependencies$exceptionStack);

        $this->addRemainingRequirementsAsException($pluginDependencies['require']$exceptionStack);

        $exceptionStack->tryToThrow($method);
    }

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