php legal licenses
Symfony Vulnerability
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
Licenses Used: MIT
...