首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Shopware 6内核上应用补丁

在Shopware 6内核上应用补丁
EN

Stack Overflow用户
提问于 2022-07-18 11:49:14
回答 1查看 278关注 0票数 1

我当前版本的Shopware有一个小问题,我想实现以下修补程序:https://gitlab.com/mh2017/shopware6-patches/-/raw/master/core/variant-listing-updater.patch

为了实现这个修补程序,我使用了cweagans/composer-patches插件。运行composer update时,尝试删除并重新安装Shopware Core:

代码语言:javascript
复制
Gathering patches for root package.
Removing package shopware/core so that it can be re-installed and re-patched.
  - Removing shopware/core (6.4.7.0)

但是,删除Core失败了,因为更新命令失败了:

代码语言:javascript
复制
> [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare
ErrorException {#7
  #message: "Warning: include(/var/www/html/vendor/composer/../shopware/core/Framework/Plugin/KernelPluginLoader/StaticKernelPluginLoader.php): failed to open stream: No such file or directory"
  #code: 0
  #file: "./vendor/symfony/error-handler/DebugClassLoader.php"
  #line: 349
  #severity: E_WARNING
  trace: {
    ./vendor/symfony/error-handler/DebugClassLoader.php:349 { …}
    ./bin/console:49 {
      › 
      › $pluginLoader = new StaticKernelPluginLoader($classLoader, null);
      › 
    }
  }
}
Script [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare handling the pre-update-cmd event returned with error code 255

这似乎是因为在尝试运行此命令时核心不在那里。当尝试使用--no-scripts命令运行此命令时,该命令将运行,但也不会修补Shopware版本(因为它也是一个脚本)。

,向Shopware核心应用补丁的最佳方法是什么,以确保composer顺利运行?

EN

回答 1

Stack Overflow用户

发布于 2022-09-12 06:15:07

编写这样简单的bash脚本,并将其添加到composer脚本或手动运行。我在我的gitlab管道中使用这个命令。

代码语言:javascript
复制
# apply commit
  curl -o /tmp/NEXT-21468.patch https://github.com/shopware/platform/commit/285c5d4b6bf9f93f7ebfbbcb3354e95fb5adb6ee.patch
  git apply -p3 --directory='vendor/shopware/core' < /tmp/NEXT-21468.patch
# use sed to replace case sensitive path
  curl -o /tmp/NEXT-20216.patch  https://github.com/shopware/platform/commit/bec6ac21a78ab84c7181dac2347e3e670f92033c.patch
  sed -i 's|/src/Core/|/src/core/|g' /tmp/NEXT-20216.patch
  sed -i 's|/src/Storefront/|/src/storefront/|g' /tmp/NEXT-20216.patch
  git apply -p2 --directory='vendor/shopware' < /tmp/NEXT-20216.patch
# apply pull request
 curl -o /tmp/NEXT-21994.patch https://patch-diff.githubusercontent.com/raw/shopware/platform/pull/2536.patch
 git apply -p3 --directory='vendor/shopware/core' < /tmp/NEXT-21994.patch
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73021860

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档