Magento:如何将配置更改从开发环境迁移到生产环境?

Magento: How can I migrate configuration changes from development to production environment?(Magento:如何将配置更改从开发环境迁移到生产环境?)
本文介绍了Magento:如何将配置更改从开发环境迁移到生产环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我们正在积极开发模块,当我们将更改推送到我们的生产站点时,通常需要进行多项配置更改.自动化这个……想法会很好吗?

We are actively developing modules and when we push the changes to our production site, there are usually several configuration changes we need to make. Would be nice to automate this...thoughts?

推荐答案

不确定它是否仍然是实际的,但如果你的意思是更改系统 -> config,那么使用这样的 config.xml 节点会更好编写数据库升级.

Not sure if it is still actual, but if you mean changes to system -> config, then it is much more better to use such config.xml nodes instead of writing database upgrade.

Magneto 将 core_config_data 表处理为全局 XML 结构,因此您可以只更改 XML 结构,而无需使用 db 表来更改系统配置.

Magneto processes core_config_data table into global XML structure, so you may just change XML structure without using db table for making changes to system configuration.

这是一个小例子:

<config>
   <stores>
       <french>
          <design>
             <theme>
                 <default>french</default>
             <theme>
          </design>
       </french>
   </stores>
   <websites>
       <base>
          <design>
             <theme>
                 <default>english</default>
             <theme>
          </design>
       </base>
   </websites>
</config>

在这个例子中,Magento 中的两个作用域的一个配置字段发生了变化.它是根据当前网站和商店定义的当前主题.

In this example one configuration field is changed for two scopes in Magento. It is definition of current theme depending on current website and store.

所以 节点包含特定商店的配置值.其中每个子元素都使用商店代码命名,并在嵌套视图中包含配置数据.而 节点包含特定网站的配置值.其中每个子元素都使用网站代码命名,并且还包含嵌套视图中的配置数据.

So <stores /> node contains configuration values for a particular store. Where each child element is named with store code and contains configuration data in nested view. And <website /> node contains configuration values for a particular website. Where each child element is named with website code and contains configuration data in nested view as well.

还有可用的 节点用于全局范围内的配置值.但如果特定值用于范围,它将被 覆盖.

Also there is available <default /> node for configuration values in global scope. But it will be overridden by <stores /> and <websites /> if a particular value is for a scope.

我仅通过 config.xml 对配置进行更改,因为当您只需要通过 Magento 安装程序进行安装而不需要更改系统 -> 配置".

I am making changes to configuration only via config.xml because deploying the project is much easier when you just need to install it via Magento installer without doing changes in "System -> Config".

这篇关于Magento:如何将配置更改从开发环境迁移到生产环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)