This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

travis30618
travis30618

I noticed that, when I install plugins via Composer, they don't get installed to the vendor/ directory, as I'd expect.

For example, if I run composer require rainlab/pages-plugin, it gets placed in plugins/rainlab/pages, rather than vendor/rainlab/pages-plugin/.

What's the reasoning behind this? This seems unusual to me. Composer modules should live in vendor/. Project code should live outside of vendor/. October's method seems unnecessary and overcomplicated – but it's entirely possible that I'm missing something.

(For those who are curious: October – or perhaps more accurately, the plugin – seems to accomplish this via a package called composer/installers. Because the plugin's composer.json defines the type as october-plugin, Composer knows to place the files in plugins/ rather than vendor/.)

I also noticed that, unlike the vendor/ directory, the plugins/ directory is not ignored by October's .gitignore – meaning that installed plugins will get committed to my project! Surely that's wrong? What am I missing here?

Here's one last thing that's possibly related. I've noticed that October tries to have it both ways: allowing developers to install plugins the "right" way (via Composer); and allowing backend users to install plugins, WordPress-style (bypassing Composer). Maybe that's what has forced October into this weird approach?

I haven't come across any documentation on any of this. It's very confusing, and could definitely be explained better.

travis30618
travis30618

Also, for the record: via the same mechanism, packages with the type october-theme get installed to themes/, and packages with the type october-module get installed to modules/. Neither of these directories are ignored by .gitignore, either.

https://github.com/composer/installers/blob/master/src/Composer/Installers/OctoberInstaller.php

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.