composer / installers

A Multi-Framework Composer Library Installer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add partial support for the generic "library" and "project" types

EusebiuOprinoiu opened this issue · comments

Composer Installers does not support custom locations for the generic library and project types.
From what I understand, this is an intentional choice because it provides way too much control, and a bad config could have unexpected consequences. (i.e. break the majority of composer projects)

Moving packages outside the vendor directory should be done responsibly.
That's why generic settings like in the snippet below should never be used.

"extra": {
    "installer-paths": {
        "custom-folder-one/{$name}/": [ "type:library", "type:project" ],
        "custom-folder-two/{$name}/":  [ "vendor:vendor-name" ]
    }
}

However, there are legitimate cases when specific packages need to be installed outside the vendor directory.
For these edge cases, it would be nice to have the option to do it, but only when done with intent.
That's why I propose you allow packages that have a generic type like library or project to be moved to custom locations, but only for rules that specify exact package names like in the example below.

"extra": {
    "installer-paths": {
        "custom-folder-one/{$name}/": [ "vendor-one/package-name" ],
        "custom-folder-two/{$name}/":  [ "vendor-two/package-name" ]
    }
}

I don't know what these legitimate cases are, but I don't think I agree they should exist. There is https://github.com/oomphinc/composer-installers-extender though if you really want this.