function SpdxLicenses::loadLicenses
Return value
void
1 call to SpdxLicenses::loadLicenses()
- SpdxLicenses::__construct in vendor/
composer/ spdx-licenses/ src/ SpdxLicenses.php
File
-
vendor/
composer/ spdx-licenses/ src/ SpdxLicenses.php, line 222
Class
Namespace
Composer\SpdxCode
private function loadLicenses() {
if (null !== $this->licenses) {
return;
}
$json = file_get_contents(self::getResourcesDir() . '/' . self::LICENSES_FILE);
if (false === $json) {
throw new \RuntimeException('Missing license file in ' . self::getResourcesDir() . '/' . self::LICENSES_FILE);
}
$this->licenses = array();
foreach (json_decode($json, true) as $identifier => $license) {
$this->licenses[strtolower($identifier)] = array(
$identifier,
$license[0],
$license[1],
$license[2],
);
}
}