Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "prefer source" for a few selected dependencies, and "prefer dist" for the rest?

I would like to install all the dependencies that are maintained by me using the "prefer source" option, and all the other dependencies not maintained by me using "prefer dist".

Is that possible with Composer? I was thinking there might be something like this, but I couldn't find it:

"my/dependency":"v1.2.3@dist",
"other/dependency":"v4.5.6@source",

Any ideas?

like image 512
ChocoDeveloper Avatar asked Aug 08 '13 22:08

ChocoDeveloper


1 Answers

There is now a preferred-install feature. (I'm not sure if this was available at the time of the original question)

Defaults to auto and can be any of source, dist or auto. This option allows you to set the install method Composer will prefer to use. Can optionally be a hash of patterns for more granular install preferences.

{
    "config": {
        "preferred-install": {
            "my-organization/stable-package": "dist",
            "my-organization/*": "source",
            "partner-organization/*": "auto",
            "*": "dist"
        }
    }
}

This lets you specify for each dependency the preferred install method.

See the repositories section for available ways the dependencies can be host.

like image 158
Alden W. Avatar answered Nov 08 '22 13:11

Alden W.