marcreichel / php-legal-licenses
这是一个用于生成包含项目中每个依赖项完整授权文本的授权文件的实用工具,用于法律目的。
1.0.1
2024-03-27 12:21 UTC
Requires
- php: ^8.2
- ext-json: *
- symfony/console: ~2.3|~3.0|~4.0|~5.0|~6.0|~7.0
- symfony/process: ~2.3|~3.0|~4.0|~5.0|~6.0|~7.0
README
PHP Legal Licenses
法律授权是一个实用工具,可以帮助生成包含项目依赖项所有重要信息的单一文本文件。在一些组织中,开源软件(OSS)的使用受到严格的控制和审计,并要求简单地记录每个OSS库。
该实用工具将在项目根目录下生成一个licenses.md
文件,其中包含所有依赖项的列表、当前安装版本、提交SHA、其描述、主页、授权列表以及如果存在于依赖项源代码中的完整授权文本。它从composer.lock
文件中获取这些信息,因此您必须至少运行过一次composer update
或composer install
,才能使用此实用工具。
安装
如果您需要在您的办公场所使用此类实用工具,那么很可能会在多个项目中使用它。因此,安装此实用工具最简单、推荐的方法是将它作为一个全局composer包。
composer global require comcast/php-legal-licenses
使用方法
如果您通过composer全局安装了php-legal-licenses,您应该能够在任何项目中运行该脚本。注意,您必须至少运行过一次composer update
或composer install
,以创建一个composer.lock
文件。
$ cd /path/to/my/project
$ which php-legal-licenses
> ~/.composer/vendor/bin/php-legal-licenses
$ php-legal-licenses generate
> Generating Licenses file...
> Done!
您还可以使用--hide-version
选项隐藏依赖项版本。
$ php-legal-licenses generate --hide-version
您可以使用--csv
选项输出csv文件。
$ php-legal-licenses generate --csv
或者同时使用这两个选项。
$ php-legal-licenses generate --hide-version --csv
示例输出
以下是为此实用工具本身生成的授权文件的片段
# Project Licenses
This file was generated by the Legal Licenses utility. It contains the name, version and commit sha, description, homepage, and license information for every dependency in this project.
## Dependencies
### psr/log (Version 1.0.2 | 4ebe3a8)
Common interface for logging libraries
Homepage: https://github.com/php-fig/log
Licenses Used: MIT
Copyright (c) 2012 PHP Framework Interoperability Group
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
### symfony/console (Version v3.3.6 | b087823)
Symfony Console Component
Homepage: https://symfony.com.cn
Licenses Used: MIT
...