Magento:如何将配置更改从开发迁移到生产环境? [英] Magento: How can I migrate configuration changes from development to production environment?

查看:185
本文介绍了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?

推荐答案

不知道如果它仍然是实际的,但如果你的意思是更改system - > 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.

磁盘进程 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.

这里是一个小例子: / p>

Here is small example:

<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.

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

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.

另外,全局范围内的配置值也可以使用< default /> 节点。但是如果一个特定的值是< stores /> < websites /> 为范围。

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:如何将配置更改从开发迁移到生产环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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