법적 라이센스는 프로젝트 종속성에 대한 중요한 정보가 모두 포함된 단일 텍스트 파일을 생성하는 데 도움이 되는 유틸리티입니다. 일부 조직에서는 OSS(오픈 소스 소프트웨어) 사용이 엄격하게 통제되고 감사되며 모든 OSS 라이브러리를 간단하게 문서화해야 합니다.
이 유틸리티는 모든 종속성 목록, 현재 설치된 버전, 커밋 sha, 해당 설명, 홈페이지, 라이센스 목록 및 전체 라이센스 텍스트(있는 경우)가 포함된 licenses.md
파일을 프로젝트 루트에 생성합니다. 종속성 소스 코드를 직접 작성합니다. 이 정보는 작곡가. composer.lock
파일에서 수신되므로 이 유틸리티를 사용하려면 composer update
또는 composer install
한 번 이상 실행해야 합니다.
귀하의 사업장에 이와 같은 유틸리티가 필요한 경우 단일 프로젝트 이상에 필요할 가능성이 높습니다. 따라서 이 유틸리티를 설치하는 가장 쉽고 권장되는 방법은 전역 작성기 패키지를 사용하는 것입니다.
composer global require comcast/php-legal-licenses
Composer를 통해 전역적으로 php-legal-licenses를 설치한 경우 모든 프로젝트에서 스크립트를 실행할 수 있습니다. composer.lock
파일을 생성하려면 composer update
또는 composer install
한 번 이상 실행해야 합니다.
$ 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
...