Open drzraf opened 5 years ago
Composer has come a long way since we started Grav and created GPM. It's definitely more capable now, and there is a fair bit of overlap, and of course composer has a huge amount of great functionality. However, there are things we do in GPM that are simply not possible in Composer. Things like support for handling license keys (currently unused, but we plan on utilizing this support soon).
We'll probably take another look at Composer or at least 'parts' of composer to have better support for dependencies with Grav 2.0, but for now in Grav 1.x there's no point making such a large and potentially impactful change.
To make this to happen, we need two things:
1) plugins must start using composer.json with all the required fields 2) we need likely to add our own packagist compatible listing as we need support for our own directory
Sooner or later, most mainstream PHP framework/CMS dropped their custom installer. Be it
bundles
installation forSymfony
ordrush-make
atDrupal
.They didn't dropped their respective command line tool, but all the rest related to
dependency-resolution/download/extraction/installation
andpre|post-install|update
scripts where standardized usingcomposer
features. And in case of particular needs (eg:Symfony flex
installation recipes) this has gone through acomposer
plugin.I went over previous discussion ¹ and still fail to see any current or future usecase for
GPM
that wouldn't be solved in a better way bycomposer
+ plugins (let's recall thatcomposer
plugins can be referenced as dependencies of the originalcomposer.json
file).Looking at
gpm list
, all of the features and underlying concepts are provided bycomposer
: distribution, repositories, stability. A tarball download isn't worth NIH since it can be done by anyone using an alias forcurl | tar -C
.https://getgrav.org/ makes a point about
sophisticated Package Manager to make it super flexible
. I tend to disagree.composer
is way more flexible and sophisticated (and well-known). And if projects frommediawiki
toWordPress/bedrock
can use it, I don't see what would make Grav so specific it could not do it.Let's take the risk to show some actual use-case that
gpm
fails to address:git
:composer --prefer-source
orpreferred-install
keycomposer-*.json
requiringwikimedia/composer-merge-plugin
post-root-package-install
script: { "post-install-cmd": { ... } }
composer/installers
andinstaller-paths
repositories
key etc...etc...etc...Granted:
(not so true anymore since composer 2.0) and can't extract a tarball given its URL on the command-line and I'm sure one may find workarounds for each above use-cases using GPM. Still, Grav is great but it's worth focusing of what it best does. The PHP package management problem has already been solved by existing mainstream tools long ago.composer
is slow¹ https://discourse.getgrav.org/t/why-gpm-and-not-composer/3124/4