composer / installers

A Multi-Framework Composer Library Installer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disabling installer in my package will still trigger the installer path when it's pulled in a project

dingo-d opened this issue · comments

In my package, I am requiring a package that has a type of wordpress-dropin. When I ran composer install that package got pulled to my project root inside wp-content folder.

So I added

  "extra": {
    "installer-disable": [
      "wordpress"
    ]
  }

in my composer.json and now the package is no longer pulling in that folder when I do a composer install (it stays in the vendor folder). Great.

But now, when I want to include my package in another project, that project will have the wp-content folder created in their project root, with the package I am requiring in it.

Is there any way I can prevent that from happening?

The problem is that if people would like to use my package in alternative WordPress installations like bedrock, that could potentially cause issues for them.

Yes.. if you don't want your package to be treated special, don't use a type that is typically associated and handled specially by composer/installer?

The problem is not my package, the problem is the package I don't have control of 🙈

That package (which is my requirement) has a type of wordpress-dropin. I mean, I did manage to solve this issue (I have a command that can delete it manually), but I thought that there is a way to prevent this from happening automatically?

I can see the problem with this approach because if my package could do this, and is a dependency it could overwrite the intended behavior of other packages :S

Yeah like you say the current system ensures every project is in control of that, and that does have drawbacks for sure, but at least it gives you control so you don't get stuck.

Ok, I mean it's a minimal annoyance at best, I managed to find the solution, so it's ok.

And I get that it could potentially cause more issues than it solved 👍🏼