如何在更新过程中处理通过`composer.json`安装的插件?

huangapple go评论49阅读模式
英文:

How to handle installed plugins via `composer.json` during update?

问题

在Shopware 6升级过程中(例如6.4.18.0 -> 6.4.19.0),出现了一个问题,即根目录下的composer.json文件发生了变化。

由于可以通过composer require安装插件,因此在升级后,所有必需的插件和已安装的插件都会丢失。

我该如何处理这种情况?这种情况的最佳实践是什么?

英文:

I have the problem that during a Shopware 6 update (e.g. 6.4.18.0 -> 6.4.19.0) the root composer.json changes.

Since it is possible to install plugins via composer require all the required plugins and installed plugins are missing after the update.

How do i handle that? What is the best-practice for this case?

答案1

得分: 2

我如何安装shopware呢?如果您是通过web安装程序安装的shopware,那么您应该通过相同的方式进行更新,composer.json 中的更改将被更新覆盖,因此您需要手动再次添加这些更改。

如果您是使用composer设置项目的,应该通过拉取最新的更改来进行更新,如果composer.json 中有手动更改,这些更改将通过git进行合并。

使用新的symfony flex设置,这一切都不再需要,您的根composer.json 在更新期间不应再受到影响。从6.5版本开始,flex设置将成为默认设置,同时webupdater也将切换到这个设置。

您可以按照此指南 来切换到新的设置。

英文:

How did you install shopware in the first place? When you install shopware over the webinstaller, then you should update over that way as well and changes in the composer.json will be overwritten by an update so you have to add those changes manually again.

If you set up your project using composer you should update by pulling the latest changes and if you have manual changes in the composer.json, those changes will be merged via git.

With the new symfony flex setup all of this should not be necessary anymore and your root composer.json should not be touched anymore during updates. The flex setup will be the default setup starting with 6.5 and also the webupdater will switch the existing installations to this setup.

You can follow this guide on how to switch to the new setup.

huangapple
  • 本文由 发表于 2023年2月8日 14:28:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/75382076.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定