sycho / license-detector
许可类型检测器
v1.0.5
2019-08-28 20:40 UTC
Requires
- php: >=7.2.0
- symfony/yaml: ^4.3.3
Requires (Dev)
- phpunit/phpunit: ^8
README
这是一个许可信息检测器,受到 Licensee 的启发,并依赖于 choosealicense.com
的数据。
安装
使用 Composer 运行以下命令
$ composer require sycho/license-detector
问题
代码使用 php 的 similar_text()
函数来告诉使用了哪个许可,该函数相当昂贵,可能需要一秒钟的时间才能得到结果。
用法
使用 Detector
类的 parse()
或 parseByPath()
方法,你将获得一个包含有关许可数据的 License
对象。
require '...\vendor\autoload.php'; use LicenseDetector\Detector; $detector = new Detector(); // By license contents $license = $detector->parse($contents); // By file path $license = $detector->parseByPath($path_to_license);
贡献
在您的提交上签名,以确认您在项目许可下提交的贡献。
示例: Signed-off-by: Your Name <youremail@example.com>
许可
此软件包在 MIT 许可下发布。此许可证的完整副本包含在软件包文件中。