PHP Classes
elePHPant
Icontem

PHP License Detector: Detect the type of project license text

Recommend this page to a friend!

  Author Author  
Name: Sami Ilyes Mazouz <contact>
Classes: 1 package by
Country: Algeria Algeria
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz  
This package can detect the type of project license text.

It can take as parameters the text of a license given in the format of a string or a file that contains the license text.

The package can detect the type of license by checking the similarity of the text of the given license with other well known types of license provided by this package as license files.

Details

license-detector

A License information detector, inspired by Licensee and relies on data from choosealicense.com

Travis (.org) branch Latest Version php License

Installation

Using Composer run the following

$ 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

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 <youremail@example.com>

License

This package is released under the MIT License. A full copy of this license is included in the package file.


  Classes of Sami Ilyes Mazouz  >  PHP License Detector  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  

 

Name: PHP License Detector
Base name: license-detector
Description: Detect the type of project license text
Version: -
PHP version: 5
License: MIT/X Consortium License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Utilities and Tools General purpose tools to simplify software development View top rated classes
Group folder image Text processing Manipulating and validating text data View top rated classes
Group folder image Artificial intelligence Automation of tasks using human-like intelligence View top rated classes
Group folder image Parsers Programming language interpreters and format parsers View top rated classes


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imagelicense-detector (4 files)
Files folder imagetests (2 files)
Files folder imagevendor (1 directory)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  license-detector  
File Role Description
  Plain text file Detector.php Class Class source
  Plain text file License.php Class Class source
  Plain text file Rule.php Class Class source
  Plain text file RuleType.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file DetectorTest.php Class Class source
  Accessible without login Plain text file LICENSE.txt Doc. Documentation

  Files folder image Files  /  vendor  
File Role Description
Files folder imagechoosealicense.com (2 files, 2 directories)

  Files folder image Files  /  vendor  /  choosealicense.com  
File Role Description
Files folder image_data (3 files)
Files folder image_licenses (36 files)
  Accessible without login Plain text file LICENSE.md Lic. License text
  Accessible without login Plain text file README.md Lic. License text

  Files folder image Files  /  vendor  /  choosealicense.com  /  _data  
File Role Description
  Accessible without login Plain text file fields.yml Lic. License text
  Accessible without login Plain text file meta.yml Lic. License text
  Accessible without login Plain text file rules.yml Lic. License text

  Files folder image Files  /  vendor  /  choosealicense.com  /  _licenses  
File Role Description
  Accessible without login Plain text file 0bsd.txt Doc. Documentation
  Accessible without login Plain text file afl-3.0.txt Doc. Documentation
  Accessible without login Plain text file agpl-3.0.txt Doc. Documentation
  Accessible without login Plain text file apache-2.0.txt Doc. Documentation
  Accessible without login Plain text file artistic-2.0.txt Doc. Documentation
  Accessible without login Plain text file bsd-2-clause.txt Doc. Documentation
  Accessible without login Plain text file bsd-3-clause-clear.txt Doc. Documentation
  Accessible without login Plain text file bsd-3-clause.txt Doc. Documentation
  Accessible without login Plain text file bsl-1.0.txt Doc. Documentation
  Accessible without login Plain text file cc-by-4.0.txt Doc. Documentation
  Accessible without login Plain text file cc-by-sa-4.0.txt Doc. Documentation
  Accessible without login Plain text file cc0-1.0.txt Doc. Documentation
  Accessible without login Plain text file ecl-2.0.txt Doc. Documentation
  Accessible without login Plain text file epl-1.0.txt Doc. Documentation
  Accessible without login Plain text file epl-2.0.txt Doc. Documentation
  Accessible without login Plain text file eupl-1.1.txt Doc. Documentation
  Accessible without login Plain text file eupl-1.2.txt Doc. Documentation
  Accessible without login Plain text file gpl-2.0.txt Doc. Documentation
  Accessible without login Plain text file gpl-3.0.txt Doc. Documentation
  Accessible without login Plain text file isc.txt Doc. Documentation
  Accessible without login Plain text file lgpl-2.1.txt Doc. Documentation
  Accessible without login Plain text file lgpl-3.0.txt Doc. Documentation
  Accessible without login Plain text file lppl-1.3c.txt Doc. Documentation
  Accessible without login Plain text file mit.txt Doc. Documentation
  Accessible without login Plain text file mpl-2.0.txt Doc. Documentation
  Accessible without login Plain text file ms-pl.txt Doc. Documentation
  Accessible without login Plain text file ms-rl.txt Doc. Documentation
  Accessible without login Plain text file ncsa.txt Doc. Documentation
  Accessible without login Plain text file odbl-1.0.txt Doc. Documentation
  Accessible without login Plain text file ofl-1.1.txt Doc. Documentation
  Accessible without login Plain text file osl-3.0.txt Doc. Documentation
  Accessible without login Plain text file postgresql.txt Doc. Documentation
  Accessible without login Plain text file unlicense.txt Doc. Documentation
  Accessible without login Plain text file upl-1.0.txt Doc. Documentation
  Accessible without login Plain text file wtfpl.txt Doc. Documentation
  Accessible without login Plain text file zlib.txt Doc. Documentation

Download Download all files: license-detector.tar.gz license-detector.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.