I've been working with the Magento Firegento custom Composer installer, and I ran into this odd bit of Composer behavior I don't understand.
Consider the following dead simple composer.json
file
{
"require": {
"magento-hackathon/magento-composer-installer": "*"
}
}
If I run compser.phar install
with this composer.json
file, I get the following.
$ composer.phar install --no-dev
Loading composer repositories with package information
Installing dependencies
- Installing aoepeople/composer-installers (v0.0.1)
Loading from cache
Writing lock file
Generating autoload files
From my mostly lay-person's understanding composer.phar
, I've said
Hey, composer, please install the
magento-hackathon/magento-composer-installer
package from packagist.org
And composer has said back to me
Sir, yes sir! Here's the
aoepeople/composer-installers
package
I don't understand why composer installed aoepeople/composer-installers
, when I asked for magento-hackathon/magento-composer-installer
.
To be clear: I understand the reason magento-hackathon/magento-composer-installer
wasn't installed is this is a package that lives in a different composer repository. My original mistake was not including this repository in my composer.json
file.
However, it doesn't make sense to me that composer would install a different package than the one I asked for. When I search packagist there's no magento-hackathon/magento-composer-installer
extension.
Why does packagist install a different extension? What's happening behind the scenes to make magento-hackathon/magento-composer-installer
resolve to aoepeople/composer-installers
? How/where in the composer source could I debug this sort of thing myself in the future?