Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Added functionality to choose one dependency from the list #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

michalbundyra
Copy link
Member

@michalbundyra michalbundyra commented Nov 10, 2017

New feature. Now we can define list of dependencies and give user a choice which one should be installed.
In case your library is compatible with many libraries, and you want force user to choose one of them and give them a list of supported libraries to choose. Configuration for this new feature is the following (extra section in composer.json):

    "extra": {
        "dependency-or": {
            "Question": [
                "package/to-choose",
                "package/or-this",
                ...
            ]
        }
    }

And user on composer update will be prompted with "Question" and list of packages:

Question
  [0] package/to-choose
  [1] package/or-this
  Make your selection: ...

User will be prompted only when none of these packages are not installed. If there is at least one package installed or defined in root composer user will be not prompted.

/cc @basz @weierophinney

@michalbundyra michalbundyra added this to the 0.3.0 milestone Nov 10, 2017
Copy link

@basz basz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't follow every code thread, but looks a nice improvement. Am I correct in that the plugin now also looks at dependencies other then those in the root composer.json.

@michalbundyra
Copy link
Member Author

@basz the plugin before also looks for installed dependencies, not only these defined in root composer.
If installed package has been found it was just added into root composer.

Change in this PR provide functionality to choose between packages to install (and as you know - I'm going to use it in http-middleware-compatibility to allow choose between http-middleware and http-server-middleware).

Before we run update composer internally after every package which
requires extra dependencies. Now we run it only once, at the end
- on post command (install/update).
@webimpress webimpress deleted a comment from coveralls Nov 10, 2017
@webimpress webimpress deleted a comment from coveralls Nov 10, 2017
@webimpress webimpress deleted a comment from coveralls Nov 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants