7

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.

  • I'm assuming you've tried running "composer install"? That should be all that is needed. – Joe Constant Apr 21 '14 at 2:13
  • @JoeConstant Yes I have — it (looks like?) the single package I installed didn't have the correct requires to make it work. Working on an answer right now. – Alan Storm Apr 21 '14 at 6:35
5

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.

  • the last part is wrong, a magento module should not require the installer. I added an explanation for this to the Readme: github.com/magento-hackathon/magento-composer-installer/… – Flyingmana Apr 27 '14 at 16:32
  • @Flyingmana I can understand why you'd say that, and it's a laudable goal, but the connect20/* packages in the FireGento repository all had this library auto-added, which means culturally speaking, the project wants its developers to add this packages as a require. It also makes sense from a usability standpoint, as expecting newbie users to completely grok the composer model seems like a mistake. – Alan Storm Apr 27 '14 at 23:39
  • no, simply no!! – Flyingmana Apr 28 '14 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.