| Server IP : 137.184.226.51 / Your IP : 10.8.0.1 Web Server : Apache/2.4.41 (Ubuntu) System : Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : ( 1000) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/php-composer-spdx-licenses/ |
Upload File : |
composer/spdx-licenses
======================
SPDX (Software Package Data Exchange) licenses list and validation library.
Originally written as part of [composer/composer](https://github.com/composer/composer),
now extracted and made available as a stand-alone library.
[](https://travis-ci.org/composer/spdx-licenses)
Installation
------------
Install the latest version with:
```bash
$ composer require composer/spdx-licenses
```
Basic Usage
-----------
```php
<?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](https://spdx.org/specifications)
> to find out more about valid license expressions.
Requirements
------------
* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.
License
-------
composer/spdx-licenses is licensed under the MIT License, see the LICENSE file for details.
Source
------
License information is curated by [SPDX](https://spdx.org/). The data is pulled from the
[License List Data](https://github.com/spdx/license-list-data) repository.
* [Licenses](https://spdx.org/licenses/index.html)
* [License Exceptions](https://spdx.org/licenses/exceptions-index.html)