2

So I'm currently playing about with Composer and Magento, and having a bit of trouble getting the magento-composer-installer to play nice.

Firstly, my composer.json files!

Module:

{
 "name":"namespace/module",
 "description":"Desc",
 "type": "magento-module",
 "suggest":{
 "magento-hackathon/magento-composer-installer": "*"
 },
 "extra":{
 "map":[
 [
 "app/etc/modules/Namespace_Module.xml",
 "app/etc/modules/Namespace_Module.xml"
 ],
 [
 "app/code/community/Namespace/Module/",
 "app/code/community/Namespace/Module/"
 ]
 ]
 }
}

Project:

{
 "require": {
 "magento/core":"1.9.1.0",
 "magento-hackathon/magento-composer-installer": "*",
 "namespace/module":"dev-master"
 },
 "repositories": [
 {
 "type": "composer",
 "url": "http://packages.firegento.com"
 },
 {
 "type": "vcs",
 "url": "/home/luker/namespace/module"
 }
 ],
 "extra": {
 "magento-root-dir":"./",
 "magento-deploystrategy":"copy",
 "magento-force": true,
 "magento-deploy-sort-priority": {
 "namespace/module": "200"
 }
 }
}

This setup does not work.

However, if I change the module to "require" magento-composer-installer instead of "suggest" it, then it works and gets copied into the code base correctly.

After reading the docs, I know this is not the correct thing to do.

What have I missed?

(To be honest, not entirely sure what I'm achieving with my magento-force and priority extras. I've just been hacking about)

Thanks

Manoj Deswal
5,80325 gold badges29 silver badges50 bronze badges
asked Dec 7, 2014 at 20:05
2
  • Take care that the Hackathon installer redirects to an new repo due to the split between the core and module installer. Commented May 12, 2015 at 14:43
  • Yeah this was posted ages ago, before the split I believe. And I'm not a fan with the direction the 3.0 series is taking, have voiced my opinions here github.com/Cotya/magento-composer-installer/issues/… Commented May 12, 2015 at 14:46

1 Answer 1

2

the suggest is the right choice, at least in theory. Because there are a lot of different installers out there today, and it should be easy to switch or even use none of them, this would not work, if modules all require the installer, or even different installers.

The problem is, that if you install both together, there are cases where the installer is not installed at first, which causes other modules to not get deployed.

this is fixed in the current alpha of version 3, but it needs more testers to find problems caused by the big refactoring.

You now have a few different ways to solve this problem.

  • Use require, even if it is not best practice
  • use one of the other installers, the AOE one for example is suggested by a lot of people
  • use the version 3 of the installer, even if it is still in alpha state
answered Dec 16, 2014 at 23:38
3

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.