Require shopware 6 plugin via composer

痞子三分冷 提交于 2021-01-29 07:08:38

问题


I am developing a custom plugin for Shopware 6. It will not be sitting in Shopware Store but our own company repo on github.

How can I make it get installed into custom/plugins instead of vendor when I run composer require plugin/name?

I tried setting up in plugin's composer "type": "shopware-plugin" and "type": "shopware-platform-plugin" but it still puts it into vendor.

There is this: https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md - I would rather specify a correct type instead of setting up an install path manually using installer-paths.

Do you know what each shopware type means?

My composer version is 1.10.8


回答1:


EDIT: Turns out that as of today (2020.07.07) composer installers is unable to handle shopware-platform-plugin types. I ended up making a custom installer that you can find here: https://github.com/radixs/composer-shopware6-installer - just add it to your plugin's composer and done.


I found what is wrong. I got confused with other guides that explain how to create custom installer and did not notice that when using default installers - they are not included in composer, they need to be required in the plugin:

    "require": {
        "shopware/core": "*",
        "composer/installers": "~1.0"
    },

I feel silly, not deleting it in case there are more geniuses like me out there.



来源:https://stackoverflow.com/questions/63265181/require-shopware-6-plugin-via-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!