LegacyPluginExtractor example

public function extractPluginZip($file$pluginName)
    {
        $archive = ZipUtils::openZip($file);
        $pluginZipDetector = new PluginZipDetector();

        if ($pluginZipDetector->isLegacyPlugin($archive)) {
            $source = $this->getPluginSource($pluginName);
            if (!$source) {
                $source = 'Community';
            }
            $destination = $this->pluginDirectories[$source];
            $extractor = new LegacyPluginExtractor();
            $extractor->extract($archive$destination);
        } elseif ($pluginZipDetector->isPlugin($archive)) {
            $this->pluginExtractor->extract($archive);
        } else {
            throw new RuntimeException('No Plugin found in archive.');
        }
    }

    /** * @throws Exception * * @return MetaStruct */
Home | Imprint | This part of the site doesn't use cookies.