Skip to content
Snippets Groups Projects

Issue #3529633: Explain Unknown parsers more clearly

All threads resolved!

Files

+ 6
5
@@ -48,12 +48,13 @@ class ComposerPackage extends InstallableLibrary {
if (!isset($this->availableVersions)) {
$this->availableVersions = [];
$id = $this->getId();
// To ensure we have the latest versions at all times, use the
// https://repo.packagist.org/p/[vendor]/[package].json URL which are
// static files and not cached.
$json = $this->requestJson(sprintf('https://repo.packagist.org/p/%s.json', $id));
// Get latest versions from the API.
// See https://packagist.org/apidoc#get-package-data.
$json = $this->requestJson(sprintf('https://repo.packagist.org/p2/%s.json', $id));
if (!empty($json['packages'][$id])) {
$this->availableVersions = array_keys($json['packages'][$id]);
foreach ($json['packages'][$id] as $package) {
$this->availableVersions[] = $package['version'];
}
}
}
return $this->availableVersions;
Loading