Giter Site home page Giter Site logo

spdx-licenses's Introduction

composer/spdx-licenses

SPDX (Software Package Data Exchange) licenses list and validation library.

Originally written as part of composer/composer, now extracted and made available as a stand-alone library.

Continuous Integration

Installation

Install the latest version with:

$ composer require composer/spdx-licenses

Basic Usage

<?php

use Composer\Spdx\SpdxLicenses;

$licenses = new SpdxLicenses();

// get a license by identifier
$licenses->getLicenseByIdentifier('MIT');

// get a license exception by identifier
$licenses->getExceptionByIdentifier('Autoconf-exception-3.0');

// get a license identifier by name
$licenses->getIdentifierByName('MIT License');

// check if a license is OSI approved by identifier
$licenses->isOsiApprovedByIdentifier('MIT');

// check if a license identifier is deprecated
$licenses->isDeprecatedByIdentifier('MIT');

// check if input is a valid SPDX license expression
$licenses->validate($input);

Read the specifications to find out more about valid license expressions.

Requirements

  • PHP 5.3.2 is required but using the latest version of PHP is highly recommended.

License

composer/spdx-licenses is licensed under the MIT License, see the LICENSE file for details.

Source

License information is curated by SPDX. The data is pulled from the License List Data repository.

spdx-licenses's People

Contributors

alcohol avatar ayesh avatar carusogabriel avatar daverandom avatar dg avatar gmishx avatar grahamcampbell avatar jakoch avatar ktomk avatar legoktm avatar lyrixx avatar mariuswilms avatar peter279k avatar reedy avatar remicollet avatar seldaek avatar staabm avatar yurunsoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spdx-licenses's Issues

Why dep on justinrainbow/json-schema ?

I don't see any usage of JsonSchema namespace in the code.

See "phpcompatinfo ananyser:run src" report

Classes Analysis
Class                             Matches REF  EXT min/Max PHP min/Max PHP all 
Composer\Spdx\SpdxLicenses        2       user             5.3.0               
Composer\Spdx\SpdxLicensesUpdater         user             5.3.0               
DOMDocument                       2       dom  5.0.0       5.0.0               
DOMXPath                          2       dom  5.0.0       5.0.0               
InvalidArgumentException          2       spl  5.1.0       5.1.0               
RuntimeException                  1       spl  5.1.0       5.1.0               
self                              2       Core 5.0.0       5.0.0               
Total [7]                                                  5.3.0               

TODOs

  • Update namespaces to Composer\Spdx or something
  • Add README
  • Add LICENSE with MIT
  • Add composer.json
  • Add phpunit.xml.dist, .travis.yml, and make sure tests run

Not sure if I am missing anything but I probably am :)

[RFC] add API to check license compatibility

Ensuring that deps in vendor/ have a license compatible with the root project is a tough task.

Other projects exist in js/Rust/Ruby/etc. I computed the following list of interest:

Later on, we could build a composer plugin like this on top:

This could be a great contribution if anyone is up to learn about the topic and contribute a PR here, if the maintainers agree?

Help wanted.

Private Package Option

Is there a way to set a package licensing as "private" or "all rights reserved". We use this on a project that has a mix of public and private packages to validate the licenses but on the private packages, we would like to be able to specify that the package is unlicensed and cannot be distributed.

NPM as added a similar option to their system and it would be really nice here.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.