2017 © Pedro Peláez
 

composer-plugin composer-extra-dependency

Composer plugin to require extra dependencies

image

webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  • Monday, November 13, 2017
  • by webimpress
  • Repository
  • 1 Watchers
  • 11 Stars
  • 133,374 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 6 Versions
  • 26 % Grown

The README.md

composer-extra-dependency

Build Status Coverage Status, (*1)

This composer plugin allows you to require composer dependencies in version specified by user during the installation. It modifies the composer.json file and add required package in require section., (*2)

This can be useful when your library supports multiple version of some dependencies and you'd like to force user to use an explicit dependency instead of depending on implicit dependencies from your library., (*3)

Usage

Require the package in your library:, (*4)

# composer require webimpress/composer-extra-dependency

Update your composer.json file: in section extra.dependency add package(s) you'd like to install with your library:, (*5)

{
    "name": "my/package",
    "description": "This is my package",
    "extra": {
        "dependency": [
            "package/to-require",
            ...
        ]
    },
    "require": {
        "php": "^5.6 || ^7.0",
        "webimpress/composer-extra-dependency": "^0.1 || ^1.0",
        ...
    }
    ...  
}

Then, during installation of your library, user will be prompted:, (*6)

# Enter the version of package/to-require to require (or leave blank to use the latest version): 

After providing the version, composer.json of the user will be update (package will be added in require section with version provided by user)., (*7)

If user does not provide the version, plugin will try to find package in the latest version matching platform requirements and other dependencies. Here also composer.json will be updated and package will be installed., (*8)

Plugin runs always on post update/install package to check if there are some dependencies to require explicitly in user composer.json file., (*9)

If dependency is already provided in user composer.json (require or require-dev section) the plugin is not going to do anything., (*10)

Please note plugin works only in development interactive mode. It means when --no-dev or --no-interaction flags are provided, plugin is not going to do anything., (*11)

The Versions

13/11 2017

dev-feature/dependency-or

dev-feature/dependency-or https://github.com/webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  Sources   Download

BSD-2-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

composer dependency webimpress

17/10 2017

dev-master

9999999-dev https://github.com/webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  Sources   Download

BSD-2-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

composer dependency webimpress

17/10 2017

0.2.2

0.2.2.0 https://github.com/webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  Sources   Download

BSD-2-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

composer dependency webimpress

12/10 2017

0.2.1

0.2.1.0 https://github.com/webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  Sources   Download

BSD-2-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

composer dependency webimpress

12/10 2017

0.2.0

0.2.0.0 https://github.com/webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  Sources   Download

BSD-2-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

composer dependency webimpress

11/10 2017

0.1.0

0.1.0.0 https://github.com/webimpress/composer-extra-dependency

Composer plugin to require extra dependencies

  Sources   Download

BSD-2-Clause

The Requires

  • php ^5.6 || ^7.0
  • composer-plugin-api ^1.1

 

The Development Requires

composer dependency webimpress