Is there a way to create a “Libraries We Use” page from composer?
Is there a way to create a “Libraries We Use” page from composer?
I am developing a proprietary php project, which is using several open source packages.
Is there a way to create a license page like this https://slack.com/libs/android directly via composer? Or do I have to copy all the licenses by hand?
<vendor>/<package>
1 Answer
1
You can find list of all installed packages in vendor/composer/installed.json
. Usually they have a license info as a short name, like MIT
.
vendor/composer/installed.json
MIT
If you want a full text of license, you should search for LICENSE
or LICENSE.md
file inside of root directory of dependency (e.g. vendor/somevendor/somepackage/LICENSE.md
). Dependencies without such file may be unlicensed and using it may be illegal.
LICENSE
LICENSE.md
vendor/somevendor/somepackage/LICENSE.md
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
You could iterate through the vendor folder and check the packages composer files. That would at least give you what type of licenses are defined, if any. You can also check if there's any LICENSE file. Regarding the name, the composer files only include the name in the
<vendor>/<package>
format. So for that, I would say, you can't (unless you extract the package name and convert it to camel case name yourself).– Magnus Eriksson
Jun 29 at 8:48