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.'
);
} }