Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow per package installer-paths for unmanaged types (or add a special type) #129

Closed
ddebernardy opened this issue Feb 7, 2014 · 2 comments

Comments

@ddebernardy
Copy link

There are times when it's necessary for a dependency to live outside of vendor/. For instance, projects such as WordPress want to live somewhere in the web/ folder.

A couple of requests to that order have occurred in the past, asking for wordpress-core or drupal-core or what not. As I understand it, they got closed owing to the fact that they're too localized, in the sense that only one package would ever use it. Which is fair enough.

The current options are to either write a custom installer to that order, or abuse composer/installers by making e.g. WordPress itself masquerade as a wordpress-plugin and configuring a custom installer-paths accordingly. The same for language files. This makes absolutely no sense...

Could we instead simply have composer/installers pick up the installer-paths directives for any package, including types it's not supposed to recognize?

Along the same lines, could we force it to recognize a type by merely encountering it in composer.json with an assorted installer-paths directive? This could be useful, for instance, in a scenario like:

{
  "name": "wordpress/core",
  "type": "wordpress-core",
… 
},
{
    "name": "wordpress/locale-fr
    "type": "wordpress-language",
…
},
…
"installer-paths": {
    "www/wp": [ "wordpress/core" ],
    "www/wp-content/language/{$name}": ["type:wordpress-language"]
}

If that is not an option, could we add a generic sounding type, e.g. web-package or custom-package or even custom that could be used by all of these projects?

@shama
Copy link
Contributor

shama commented Feb 7, 2014

While I understand the large desire for this type of thing, I don't think it belongs in composer/installers. The above use case is what custom installers are for.

Each framework has a choice:

  1. Adopt composer and have all packages use the generic library type (highly preferred).
  2. Officially support a custom installer to massage composer to their liking.
  3. Completely ignore composer and leave it up to the users to write custom installers.

composer/installers is meant to push frameworks to number 1.

Feel free to open an issue on composer itself though. See if they have any interest in supporting installer-paths for generic package types at the composer level.

@shama shama closed this as completed Feb 7, 2014
@ddebernardy
Copy link
Author

I understand where you're coming from, but rejecting this on philosophical grounds doesn't seem very constructive. What's going to end up happening is that one or more developers will create a composer plugin that allows precisely what is requested here.

Some have already, in fact:

https://github.com/mnabil/composer-installer-plugin

Methinks a few of such plugins should at least be mentioned somewhere in the docs. Because they're rather difficult to find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants