2

Composer allows users to create packages that are composer plugins. Plugins can subscribe to events emitted during the regular use of a composer and do things.

Composer also allows users to create classes and objects that are composer installers. A Composer Installer in a class that can install files outside of the composer vendor folder. The way you tell Composer about an installer is to create a composer plugin, and in the plugin's activate method you instantiate an installer and add it to composer's installation manager.

These are both concepts I came to understand by reading the above linked docs. What I don't understand is, what is a composer package of type composer-installer. I don't see any mention of these in the docs

There appear to be around 115 of these packages in the packagist registry. I've taken a look at one of these and it appears to be a package you can add as a composer plugin, but that composer will recognize as an installer. I'm not familiar enough with how composer installers to know if this is correct, or if there's different functionality in these composer-installer package.

What are these packages? Was this some sort of alpha feature of composer installers ended up being abandoned? Or is this a future feature? Regardless -- will packages of type composer-installer be supported into the future, or is this some weird vestigial thing that's best to leave behind?

yivi
  • 42,438
  • 18
  • 116
  • 138
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
  • Not sure if you have seen https://github.com/composer/installers which seems to give a more comprehensive list of packages and some more documentation. – Nigel Ren Sep 15 '20 at 06:31
  • I have seen that repo, but thank you Nigel. I was not, however, able to find reference to the `type: composer-installer` packages in there. Did I miss them? – Alana Storm Sep 15 '20 at 06:53

1 Answers1

1

The type composer-installer was meant for packages that implemented the custom installer.

Currently, it's recommended that the type for this custom installers is set to composer-plugin, but it used to be composer-installer. I imagine this was changed around the time when the package composer/installers was developed and released (which makes many of the old custom installers obsolete anyway).

The first official release of composer/installers was on Jun 2014, and with a bit of digital archaeology we can see that the documentation changes on https://getcomposer.org/doc/articles/custom-installers.md happened just a bit earlier than that:

August 19 2013

type:composer-installers is still recommended: screenshot showing a composer.json file using type:composer-installers

September 06 2013

Changes were afoot, and briefly it was recommended to set the type to `composer-installer-plugin´: screenshot showing a composer.json file using type:composer-installer-plugin

September 27 2013

By now we already have the current composer-plugin recommendation, which hasn't change since: screenshot showing a composer.json file using type:composer-plugin


tldr;

Forget about composer-installers, that type has not been used in some time. A good amount of those 115 packages are likely abandoned. The type one should use for custom installers is, and has been for some years: composer-plugin.

yivi
  • 42,438
  • 18
  • 116
  • 138