多个模块覆盖 Magento 中的相同核心文件 [英] Multiple modules overriding same core file in Magento

查看:30
本文介绍了多个模块覆盖 Magento 中的相同核心文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Magento 如何处理覆盖同一个核心文件的多个模块?是否可以?怎么做的?

How does Magento handle multiple modules overriding the same core file? Is it possible? How is it done?

推荐答案

您有 3 种解决冲突的选择:

You have 3 choices for resolving conflicts:

  • 将一个冲突文件中的代码合并到另一个文件中,并在一个文件中关闭重写 config.xml
  • 关闭一个 config.xml 中的重写,然后使冲突的扩展 PHP 文件扩展另一个扩展
  • 使用 功能使一个扩展依赖于另一个.然后他们将按该顺序重写
  • Merge the code from one conflicting file into another and switch off the rewrite config.xml in one
  • Switch off the rewrite in one config.xml and then make the conflicting extension PHP file extend the other extension
  • Use the <depends> capability to make one extension depend on another. They will then rewrite in that order

示例(选项#2)

class A_Extension_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage

您可以将其更改为:

class A_Extension_Model_Type_Onepage extends B_Extension_Model_Type_Onepage

阅读更多@http://www.webshopapps.com/blog/2010/11/resolving-magento-extension-conflicts/

这篇关于多个模块覆盖 Magento 中的相同核心文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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