Question

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

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top