通过Composer需要Shopware 6插件 [英] Require shopware 6 plugin via composer

查看:70
本文介绍了通过Composer需要Shopware 6插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Shopware 6开发自定义插件.它将不会位于Shopware Store中,而是我们自己的公司在github上的仓库.

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

当我运行 composer require plugin/name 时,如何使其安装到 custom/plugins 中而不是 vendor 中?

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

我尝试在插件的作曲家中设置"type":"shopware-plugin" "type":"shopware-platform-plugin" 仍会将其放入供应商.

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?

我的作曲家的版本是1.10.8

My composer version is 1.10.8

推荐答案

事实证明,截至今天(2020.07.07),作曲家安装程序无法处理 shopware-platform-plugin 类型.我最终制作了一个自定义安装程序,您可以在这里找到: https://github.com/radixs/composer-shopware6-installer -只需将其添加到插件的作曲器中即可.

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.

这篇关于通过Composer需要Shopware 6插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆