Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sycho9/license-detector
📜 A license information detector
https://github.com/sycho9/license-detector
composer license license-detector php similarity-measures
Last synced: 24 days ago
JSON representation
📜 A license information detector
- Host: GitHub
- URL: https://github.com/sycho9/license-detector
- Owner: SychO9
- License: mit
- Created: 2019-08-23T09:50:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-28T20:46:08.000Z (about 5 years ago)
- Last Synced: 2024-04-17T15:41:19.983Z (7 months ago)
- Topics: composer, license, license-detector, php, similarity-measures
- Language: PHP
- Homepage:
- Size: 144 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# license-detector
A License information detector, inspired by [Licensee](https://github.com/licensee/licensee) and relies on data from [`choosealicense.com`](https://choosealicense.com/)![Travis (.org) branch](https://img.shields.io/travis/SychO9/license-detector/master?style=flat-square)
![Latest Version](https://img.shields.io/github/release/SychO9/license-detector.svg?style=flat-square&color=orange)
![php](https://img.shields.io/badge/php->=7.2-red.svg?style=flat-square&color=blue)
![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square&color=green)## Installation
Using Composer run the following```gitattributes
$ composer require sycho/license-detector
```## Problem
The code uses php's `similar_text()` function to tell which license is the one used, the function is quiet expensive and can take up to one second for the results.## Usage
Using the `Detector` class's `parse()` or `parseByPath()` methods, you get a `License` object containing data about the license```php
require '...\vendor\autoload.php';use LicenseDetector\Detector;
$detector = new Detector();
// By license contents
$license = $detector->parse($contents);// By file path
$license = $detector->parseByPath($path_to_license);
```## Contributing
Sign-off your commits, to acknowledge your submission under the license of the project.Example: `Signed-off-by: Your Name `
## License
This package is released under the MIT License. A full copy of this license is included in the package file.