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

Support arbitrary package types #13

Closed mbrodala closed 8 years ago

mbrodala commented 9 years ago

This makes sure not only packages of "type": "library" are supported but any type.

mnsami commented 9 years ago

hello @mbrodala sorry for the late reply,

but won't this make all packages, no matter what type they are, go throw LibraryInstaller and would cause faulty behavior?

May be I need to modify the support function in each installer type, wouldn't that be a better approach?

mbrodala commented 9 years ago

Faulty behavior can be caused by packages which heavily rely on the default vendor-dir setup of Composer. But if one uses this package, he should know what he does anyways.

My usecase was pulling in piwik/piwik as dependency but still install it into a web directory. But since the Composer support of that package isn't that well anyways, I had to go the Git clone route for now.

mnsami commented 9 years ago

I think the main problem is people out there are using wrong typed in their composer.json, piwik/piwik is using "type":"application", which is a not supported type by composer.

This, my, package's purpose is to provide flexibility for consumers with also preserving the default behavior of the composer installer.

Let me do some investigations and tests, because I'm curious how will this behave with pear packages or tarred, as from previous experience, they were downloaded but never untarred and I don't want to break the functionality to fix other people miss-using composer properties.

NB I'm going for vacations for 1 month starting from next week and will be back on 14th of October, so please be patience, if I didn't reply before.

thanks

drAlberT commented 8 years ago

piwik should be supported by composer/installers ..

mbrodala commented 8 years ago

@drAlberT But only Piwik plugins are handled by composer/installers. (Package type piwik-plugin.)

drAlberT commented 8 years ago

@mbrodala you are right ...

mnsami commented 8 years ago

@mbrodala

Overriding the support function for the LibraryInstaller and always returning true will cause everything and every package no-matter the type of it, be handled by the LibraryInstaller and that shouldn't be the case.

For me, that is altering the entire composer behavior, may be implementing another installer or actually making a pull request to piwik/piwik to put the correct composer type.

Also, as per the composer documentation https://getcomposer.org/doc/04-schema.md#type

The type of the package. It defaults to library.

Package types are used for custom installation logic. If you have a package that needs some special logic, you can define a custom type. This could be a symfony-bundle, a wordpress-plugin or a typo3-module. These types will all be specific to certain projects, and they will need to provide an installer capable of installing packages of that type.

what is your opinion?

mbrodala commented 8 years ago

@mnsami I agree with your observation that this would have a grave impact. I'll abandon this.