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.
[![Continuous Integration](https://github.com/composer/spdx-licenses/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/composer/spdx-licenses/actions)
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)
没有合适的资源?快使用搜索试试~ 我知道了~
spdx-licenses:用于处理SPDX许可证列表和验证许可证的工具
共11个文件
yml:3个
json:3个
md:2个
5星 · 超过95%的资源 需积分: 34 2 下载量 48 浏览量
2021-02-25
06:57:14
上传
评论
收藏 16KB ZIP 举报
温馨提示
作曲家/ spdx许可证 SPDX(软件包数据交换)许可证列表和验证库。 最初是作为一部分编写的,现在已提取并作为独立的库提供。 安装 使用以下命令安装最新版本: $ 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' ); //
资源详情
资源评论
资源推荐
收起资源包目录
spdx-licenses-main.zip (11个子文件)
spdx-licenses-main
composer.json 1KB
res
spdx-exceptions.json 3KB
spdx-licenses.json 44KB
.github
workflows
phpstan.yml 1KB
continuous-integration.yml 1KB
lint.yml 550B
LICENSE 1KB
src
SpdxLicenses.php 10KB
phpstan.neon.dist 213B
CHANGELOG.md 3KB
README.md 2KB
共 11 条
- 1
FeMnO
- 粉丝: 20
- 资源: 4609
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1