getPluginName example


    public function extract(string $zipFilePath, bool $delete, string $type): void
    {
        $archive = ZipUtils::openZip($zipFilePath);

        $destination = $this->extensionDirectories[$type];

        if (!is_writable($destination)) {
            throw new PluginExtractionException(sprintf('Destination directory "%s" is not writable', $destination));
        }

        $pluginName = $this->getPluginName($archive);
        $this->validatePluginZip($pluginName$archive);

        $oldFile = $this->findOldFile($destination$pluginName);
        $backupFile = $this->createBackupFile($oldFile);

        try {
            $archive->extractTo($destination);

            if ($backupFile !== null) {
                $this->filesystem->remove($backupFile);
            }

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