Tools for working with the SPDX license list and validating licenses.

Overview

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.

Comments
  • Update to SPDX 3.0 license list

    Update to SPDX 3.0 license list

    Notably, the GNU licenses now have -only or -or-later suffixes.

    In addition, I covered the updater to the JSON data files instead of screen-scraping from the SPDX website.

    One question I had was whether we need to keep backwards-compatibility with the older license names, and include the deprecated license names?

    opened by legoktm 10
  • Make license ID comparisons case-insensitive

    Make license ID comparisons case-insensitive

    Addresses https://github.com/composer/composer/issues/7039

    This patch needs review - there are a couple of things I'm not 100% sure about, see comments in diff.

    opened by DaveRandom 9
  • Please, make test available in github archive

    Please, make test available in github archive

    Please consider removing tests from .gitattributes. This make downstream CI easier. (really small)

    See http://blog.remirepo.net/post/2014/08/12/Koschei-continuous-integration-of-PHP-stack-in-Fedora

    opened by remicollet 9
  • Retrieve list of license identifiers and names

    Retrieve list of license identifiers and names

    This PR implements getLicensesList() method and adds the corresponding test.

    The method allows us to retrieve a list of all loaded identifiers. The result of the method can be used for i.e. driving a select input field where end users pick a valid license.

    opened by mariuswilms 6
  • Private Package Option

    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

    opened by valeryan 4
  • Updated to PHPUnit 5.7 and PHPUnit Mock Objects 3.4

    Updated to PHPUnit 5.7 and PHPUnit Mock Objects 3.4

    I updated PHPUnit to ^5.7 and PHPUnit Mock Objects to ^3.4, and dropped support to PHP versions 5.3, 5.4 and 5.5, as PHPUnit 5 requires PHP 5.6.

    Why dropped support for PHP versions 5.3, 5.4, and 5.5?

    These versions are no longer supported by PHP.

    Why PHPUnit 5.7 and not PHPUnit 6?

    Because PHPUnit 6 requires PHP 7, and we will need to work on that.

    I use PSR-1 while extending PHPUnit TestCase class. This will help us when to migrate to PHPUnit 6, that no longer support snake case namespaces.

    Also, added PHP 7.2 to Travis CI and PHP 5.6 as minimum version in Requirements section :rocket:

    opened by carusogabriel 4
  • Update to SPDX 3.7 & 3.8

    Update to SPDX 3.7 & 3.8

    See the following for a summary of the changes:

    • https://github.com/spdx/license-list-XML/releases/tag/v3.7
    • https://github.com/spdx/license-list-XML/releases/tag/v3.8
    opened by Yurunsoft 2
  • Update to SPDX 3.4

    Update to SPDX 3.4

    opened by legoktm 2
  • Update to SPDX 3.3

    Update to SPDX 3.3

    opened by legoktm 2
  • Use PSR-1 for PHPUnit TestCase

    Use PSR-1 for PHPUnit TestCase

    opened by carusogabriel 2
  • add SpdxLicenses::getResourcesDir method

    add SpdxLicenses::getResourcesDir method

    This method make resources path defined in a single place.

    This make "downstream" distribution easier (as "res" static files are outside the library tree). Shouldn't change anything for other usage.

    opened by remicollet 2
  • [RFC] add API to check license compatibility

    [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:

    • https://github.com/HansHammel/license-compatibility-checker/
    • https://github.com/jpvillaisaza/licensor
    • https://github.com/timelsass/wp-license-compatibility/
    • https://github.com/Nemo157/cargo-lichking/blob/
    • https://github.com/librariesio/license-compatibility/

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

    • https://github.com/codepunkt/webpack-license-plugin/

    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.

    opened by nicolas-grekas 4
Releases(1.5.7)
Owner
Composer
Composer
A curated list of awesome Laravel bookmarks, packages, tools, articles, tutorials and related resources.

ATTENTION: This list is obsolete and discontinued. Please find a much more comprehensive, much more well-maintained awesome-laravel list at chiraggude

Unnawut Leepaisalsuwanna 96 Aug 5, 2022
A Magento implementation for validating JSON Structures against a given Schema

Zepgram JsonSchema A Magento implementation for validating JSON Structures against a given Schema with support for Schemas of Draft-3 or Draft-4. Base

Benjamin Calef 1 Nov 5, 2021
A small library for validating International Bankaccount Numbers (IBANs) based on the IBAN Registry provided by SWIFT

A small library for validating International Bankaccount Numbers (IBANs) based on the IBAN Registry provided by SWIFT

Jan Schädlich 68 Nov 5, 2022
Iran decoration platform is an open source Php web application where you can find your job as a freelancer working in people home in decoration positions and others.

Iran-Decoration Platform Iran decoration platform is an open source Php web application where you can find your job as a freelancer working in people

AmirHossein Mohammadi 7 Jul 25, 2022
BetterWPDB - Keeps you safe and sane when working with custom tables in WordPress.

BetterWPDB - Keeps you safe and sane when working with custom tables in WordPress.

Snicco 21 Oct 27, 2022
PHP library with basic objects and more for working with Facebook/Metas Conversions API

PHP library with basic objects and more for working with Facebook/Metas Conversions API Installation The easiest way to install this library is by ins

null 4 Oct 12, 2022
A set of utilities for working with vk api!

vk-utils Документация на русском языке Installation composer require labile/vk-utils How to use it? Simple example use Astaroth\VkUtils\Client; $api

null 1 Jan 3, 2022
A plugin for working with popular money libraries in Pest

This package is a plugin for Pest PHP. It allows you to write tests against monetary values provided by either brick/money or moneyphp/money using the same declarative syntax you're used to with Pest's expectation syntax.

Luke Downing 19 Oct 30, 2022
A PHPStan package that supports working with Extbase

PHPStan for Extbase This package provides a couple of stubs and services to make your life easier when working with PHPStan and Extbase. Examples clas

Alexander Schnitzler 7 Dec 10, 2021
A simple package for working with money.

Money A simple package for working with money. Main features: Simple API Livewire integration Custom currency support Highly customizable formatting R

ARCHTECH 143 Nov 18, 2022
I am actively working on this - v1.3 stable-DEV

Batch-OBF-php This Obf .bat files v swag ngl only reason im posting the code is cuz i people have said im ratting them by changing the code of the .ba

INZO_Technologies 1 Jan 26, 2022
A library for working with StatsD in PHP

StatsD PHP Library A library for working with StatsD in PHP. Install Via Composer: composer require league/statsd To use the Statsd Service Provider,

The League of Extraordinary Packages 338 Nov 8, 2022
Strings Package provide a fluent, object-oriented interface for working with multibyte string

Strings Package provide a fluent, object-oriented interface for working with multibyte string, allowing you to chain multiple string operations together using a more readable syntax compared to traditional PHP strings functions.

Glowy PHP 14 Mar 12, 2022
PHP library for working with Demandware XML files

PHP Demandware XML A PHP library for working with Demandware XML files. Exporting: Supports category, product, variant and assignment files and allows

Fusions PIM 3 Jan 9, 2022
A complete solution for group projects in organizations that lets you track your work in any scenario. Working in a team is a cumbersome task, ease it using our project management system.

SE-Project-Group24 What is Evolo? Evolo is Dashboard based Project Management System. A complete solution for group projects in organizations that let

Devanshi Savla 2 Oct 7, 2022
:globe_with_meridians: List of all countries with names and ISO 3166-1 codes in all languages and data formats.

symfony upgrade fixer • twig gettext extractor • wisdom • centipede • permissions handler • extraload • gravatar • locurro • country list • transliter

Saša Stamenković 5k Nov 25, 2022
A list of ICs and IPs for AI, Machine Learning and Deep Learning.

AI Chip (ICs and IPs) Editor S.T.(Linkedin) Welcome to My Wechat Blog StarryHeavensAbove for more AI chip related articles Latest updates Add news of

Shan Tang 1.4k Nov 30, 2022
DiscordLookup | Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more...

DiscordLookup Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more... Website Getting Help Tool

Felix 66 Nov 19, 2022
Php-file-iterator - FilterIterator implementation that filters files based on a list of suffixes, prefixes, and other exclusion criteria.

php-file-iterator Installation You can add this library as a local, per-project dependency to your project using Composer: composer require phpunit/ph

Sebastian Bergmann 7.1k Nov 27, 2022