Search code examples
phpcomposer-phpshopware

What is the custom/plugins/*/packages/* pattern used for in Shopware?


In Shopware's development template project there's three composer path repositories listed. The

    {
        "type": "path",
        "url": "custom/plugins/*",
        "options": {
            "symlink": true
        }
    },

configuration appears to setup a path repository that will allow you to work locally with a Shopware plugin that's distributed via composer.

There's also

    {
        "type": "path",
        "url": "platform",
        "options": {
            "symlink": true
        }
    }

which configures a path repository that will let you work with the shopware/platform composer package if you (per the setup instructions) clone or copy the shopware/platform code to ./platform.

Finally, there's the following folder

    {
        "type": "path",
        "url": "custom/plugins/*/packages/*",
        "options": {
            "symlink": true
        }
    },

What special files does the pattern custom/plugins/*/packages/* allow you to work with? Put another way, what is the packages folder that inside a Shopware plugin's folder/


Solution

  • The custom/plugins/*/packages/* path repository enables you to ship private dependencies within your plugin. So the plugin itself could require those packages like every other package in its composer.json file, but the source is provided by the plugin itself under this special path.

    You can find the according PR here: https://github.com/shopware/development/pull/141