Tools for working with the SPDX license list and validating licenses.
PHP
1,385
181 commits
updated Oct 1, 2026
SPDX (Software Package Data Exchange) licenses list and validation library.
Originally written as part of composer/composer, now extracted and made available as a stand-alone library.
Install the latest version with:
$ composer require composer/spdx-licenses
<?php
use Composer\Spdx\SpdxLicenses;
$licenses = new SpdxLicenses();
// get a license by identifier
$licenses->getLicenseByIdentifier('MIT');
// get a license exception by identifier
$licenses->getExceptionByIdentifier('Autoconf-exception-3.0');
// get a license identifier by name
$licenses->getIdentifierByName('MIT License');
// check if a license is OSI approved by identifier
$licenses->isOsiApprovedByIdentifier('MIT');
// check if a license identifier is deprecated
$licenses->isDeprecatedByIdentifier('MIT');
// check if input is a valid SPDX license expression
$licenses->validate($input);
Read the specifications to find out more about valid license expressions.
composer/spdx-licenses is licensed under the MIT License, see the LICENSE file for details.
License information is curated by SPDX. The data is pulled from the License List Data repository.
2,153 followers · starred Dec 2017
327 followers · starred Mar 2020
376 followers · starred Mar 2018
415 followers · starred Dec 2017
Tools for working with the SPDX license list and validating licenses.
PHP
1,385
181 commits
updated Oct 1, 2026
SPDX (Software Package Data Exchange) licenses list and validation library.
Originally written as part of composer/composer, now extracted and made available as a stand-alone library.
Install the latest version with:
$ composer require composer/spdx-licenses
<?php
use Composer\Spdx\SpdxLicenses;
$licenses = new SpdxLicenses();
// get a license by identifier
$licenses->getLicenseByIdentifier('MIT');
// get a license exception by identifier
$licenses->getExceptionByIdentifier('Autoconf-exception-3.0');
// get a license identifier by name
$licenses->getIdentifierByName('MIT License');
// check if a license is OSI approved by identifier
$licenses->isOsiApprovedByIdentifier('MIT');
// check if a license identifier is deprecated
$licenses->isDeprecatedByIdentifier('MIT');
// check if input is a valid SPDX license expression
$licenses->validate($input);
Read the specifications to find out more about valid license expressions.
composer/spdx-licenses is licensed under the MIT License, see the LICENSE file for details.
License information is curated by SPDX. The data is pulled from the License List Data repository.
2,153 followers · starred Dec 2017
327 followers · starred Mar 2020
376 followers · starred Mar 2018
415 followers · starred Dec 2017