DownloadStep example

$version = $this->getCachedVersion();
        if (!$version instanceof Version) {
            $this->View()->assign('message', 'Could not get version information');
            $this->View()->assign('success', false);

            return;
        }

        try {
            $destination = $this->createDestinationFromVersion($version);
            $downloadStep = new DownloadStep($version$destination);
            $result = $downloadStep->run($offset);
            $this->view->assign($this->mapResult($result));
        } catch (Exception $e) {
            $this->Response()->setStatusCode(500);
            $this->View()->assign('message', $e->getMessage());
            $this->View()->assign('success', false);
        }
    }

    /** * @return void */
public function downloadRange(RangeDownloadRequest $request)
    {
        // Load SwagUpdate so the DownloadStep can be auto-loaded         Shopware()->Plugins()->Backend()->SwagUpdate();

        $version = new Version([
            'uri' => $request->getUri(),
            'size' => $request->getSize(),
            'sha1' => $request->getSha1(),
        ]);

        return (new DownloadStep($version$request->getDestination()))->run($request->getOffset());
    }

    /** * @param string $file * @param string $pluginName * * @throws Exception */
    public function extractPluginZip($file$pluginName)
    {
        $archive = ZipUtils::openZip($file);
        
Home | Imprint | This part of the site doesn't use cookies.