PHP code example of lendable / composer-license-checker
1. Go to this page and download the library: Download lendable/composer-license-checker library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lendable / composer-license-checker example snippets
declare(strict_types=1);
use Lendable\ComposerLicenseChecker\LicenseConfigurationBuilder;
return (new LicenseConfigurationBuilder())
->addLicenses(
'MIT',
'BSD-2-Clause',
'BSD-3-Clause',
'Apache-2.0',
// And other licenses you wish to allow.
)
->addAllowedVendor('vendor_name') // Allow any license from a specific vendor, i.e. your own company.
->addAllowedPackage('vendor_name/foo_bar') // Allow a specific package regardless of licensing.
->build();
sh
./vendor/bin/composer-license-checker [--allow-file path/to/configuration_file.php]