2017 © Pedro Peláez
 

composer-plugin composer-suggest

Composer plugin to install a custom group of suggested packages, based on keyword patterns. ' vi .env && composer install '

image

nfreear/composer-suggest

Composer plugin to install a custom group of suggested packages, based on keyword patterns. ' vi .env && composer install '

  • Monday, April 24, 2017
  • by nfreear
  • Repository
  • 1 Watchers
  • 4 Stars
  • 293 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 8 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Build status — Travis-CI ![Latest Stable Version][packagist-icon] MIT License, (*1)

composer-suggest

A Composer plugin to install a custom group of suggested packages, based on keyword patterns. (_Caution_), (*2)

Example composer.json:, (*3)

{
    "suggest": {
      "a/b": "1.0; This package is for [LACE] only",
      "c/d": "2.1, This package is for JuxtaLearn and LACE.",
      "e/f": "3.2, This is just for [JXL].",
      "g/h": "1.0-beta; Experiment-A"
    }
}

Usage

  1. Set an environment variable containing a pattern/keywords in a .env file,, (*4)

    echo 'NF_COMPOSER_SUGGEST="(EXP|LACE)"' > .env
    
  2. Require the plugin,, (*5)

    composer require nfreear/composer-suggest
    
  3. Install as you would normally (verbose),, (*6)

    composer -vvv install
    

Legacy

In Composer script mode, an example composer.json might contain:, (*7)

{
    "suggest": {
      "a/b": "1.0; This package is for [LACE] only",
      "c/d": "2.1, This package is for JuxtaLearn and LACE.",
      "e/f": "3.2, This is just for [JXL].",
      "g/h": "1.0-beta; Experiment-A"
    },

    "scripts": {
      "dry-run-suggest": "\\Nfreear\\Composer\\Suggest::dryRun",
      "install-suggest": "\\Nfreear\\Composer\\Suggest::install",
      "install-lace": "./vendor/bin/suggest --dry LACE"
    }
}

Legacy usage:, (*8)

>  composer -v install-lace

Legacy advanced usage:, (*9)

>  composer -v dry-run-suggest "Ju?X(ta)?L"    # Packages suggested for 'Juxtalearn' & 'JXL'.
>  composer -v dry-run-suggest "Experiment-A"

Test

composer test

Caution

Use of the composer-suggest plugin implies that you probably won't commit composer.lock to version control. Various people say this is bad, and as a general rule they are probably correct., (*10)

Composer-suggest works well when all/most of the dependencies in require and suggest have precise version constraints (1.2.3) as opposed to loose ones (1.*, >= 1.5..). It is also useful during rapid development phases of a project. See it in use in the LACE/ OER Research Hub code, and Open Media Player code-base., (*11)

Caveat utilitor!, (*12)

Developed for the LACE Evidence Hub, part of the Learning Analytics Community Exchange project., (*13)

Inspired by and based in part on the composer-merge-plugin – thank you!, (*14)


License: MIT, (*15)

© 2016 The Open University. (Institute of Educational Technology), (*16)

The Versions

24/04 2017

dev-master

9999999-dev

Composer plugin to install a custom group of suggested packages, based on keyword patterns. ' vi .env && composer install '

  Sources   Download

MIT

The Requires

 

The Development Requires

pattern regex suggest composer-plugin openuniversity iet-ou lace

24/04 2017

v1.2.0

1.2.0.0

Composer plugin to install a custom group of suggested packages, based on keyword patterns. ' vi .env && composer install '

  Sources   Download

MIT

The Requires

 

The Development Requires

pattern regex suggest composer-plugin openuniversity iet-ou lace

27/07 2016

v1.1.0-rc.3

1.1.0.0-RC3

Composer plugin to install a custom group of suggested packages, based on keyword patterns. ' vi .env && composer install '

  Sources   Download

MIT

The Requires

 

The Development Requires

pattern regex suggest openuniversity iet-ou lace

24/08 2015

v1.1.0-rc.2

1.1.0.0-RC2

Composer plugin to install a custom group of suggested packages, based on keyword patterns. $ vi .env && composer install $

  Sources   Download

MIT

The Requires

 

The Development Requires

pattern regex suggest openuniversity iet-ou lace

10/06 2015

v1.1.0-rc.1

1.1.0.0-RC1

Composer plugin to install a custom selection of suggested packages, based on keyword patterns. $ vi .env && composer install $

  Sources   Download

MIT

The Requires

 

The Development Requires

pattern regex suggest openuniversity iet-ou lace

07/05 2015

1.0.0-beta

1.0.0.0-beta

Composer script to install suggestions simply, based on keyword patterns. $ composer install-suggest ABC $ (Developed via LACE project)

  Sources   Download

MIT

The Requires

  • php >=5.3.2
  • composer-plugin-api 1.0.0

 

The Development Requires

composer pattern regex suggest openuniversity iet-ou lace