Magento – How to use Modules installed with Composer and Firegento in the Magento installation

composermagento-1module

This is a super basic Magento/Composer question — how are users (i.e. me) supposed to make a Magento system aware of packages installed via composer/firegento?

That is — most of the tutorials I've found cover setting up a composer.json file, and I've managed the without a problem. I can install packages into vendor to my heart's content.

They'll also mention adding the following to your composer.json so "[something]" knows where to install the modules

"extra":{
    "magento-root-dir":"./"
 }

However, what I haven't been able to figure out with the existing documentation is what command do I need to run in order to copy or symlink the files in ./vendor into my Magento root?

The tutorials I've found say use the magento-hackathon/magento-composer-installer project on GitHub — but this project's README seems more focused on creating your own packages than on basic usage.

Best Answer

The short version: If everything's configured correctly, you don't need to do anything. The way packages.firegento.com works is by taking advantage of a Composer custom installer plugin. This custom installer plugin handles symlinking or copying the files (depending on the value of magento-deploystrategy in the extra configuration section)

However, somewhere in your composer require configuration, you need to include the magento-hackathon/magento-composer-installer package.

"require": {
    "magento-hackathon/magento-composer-installer": "*"
},

This package installs the composer plugin, which in turn enables the custom installation functionality. This is why every composer plugin should have this package in its require list.

Related Topic