mnsami / composer-custom-directory-installer

A composer plugin, to install differenty types of composer packages in custom directories outside the default composer default installation path which is in the vendor folder.
https://packagist.org/packages/mnsami/composer-custom-directory-installer
MIT License
138 stars 27 forks source link

[Enhancement] Implement a new variable {$version} #18

Closed ZaDarkSide closed 5 years ago

ZaDarkSide commented 8 years ago

As with {$vendor} and {$name}, I would like to see a {$version} variable that will have the version of the package installed so that the following configuration:

    "extra": {
        "installer-paths": {
            "./libraries/{$name}-{$version}": ["vendor/pkgname"]
        }
    }

Will result in installing the package to the following directory:

 /libraries/pkgname-1.0.0
mnsami commented 7 years ago

hello @ZaDarkSide what is the use case behind this? is it possible to use same package twice with different versions in the same app?

ZaDarkSide commented 7 years ago

No, composer doesn't supports this, also PHP can't load the same class twice, but the use case is for the creation of the directory of the library to contain if you wish also the version number.

mnsami commented 5 years ago

@ZaDarkSide appending the version number to the package directory name, looks to me a diversion from the main composer functionality, it doesn't mean anything as you can figure it out easily from your composer.json or composer.lock which is the most rightful place for it, I don't want to divert from the main composer functionality tbh.

We can re-open it if you want to discuss more.

ZaDarkSide commented 5 years ago

@mnsami Well what connection there is between how composer handles things and how I want to structure my project libraries? The structure of my project should be chosen by me, not dictated by composer. Why use this (composer-custom-directory-installer) if it does not allows you to make custom directories how I need them to be? What's the point?