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
...