downloadPackage example


    public function downloadMissingPackages(): array
    {
        $entries = $this->loadImportMapEntries();
        $downloadedPackages = [];

        foreach ($entries as $entry) {
            if (!$entry->isDownloaded || $this->assetMapper->getAsset($entry->path)) {
                continue;
            }

            $this->downloadPackage(
                $entry->importName,
                $this->httpClient->request('GET', $entry->url)->getContent(),
            );

            $downloadedPackages[] = $entry->importName;
        }

        return $downloadedPackages;
    }

    /** * @internal */
Home | Imprint | This part of the site doesn't use cookies.