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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

In PHP how can you clear a WSDL cache?(在 PHP 中如何清除 WSDL 缓存?)
failed to open stream: HTTP wrapper does not support writeable connections(无法打开流:HTTP 包装器不支持可写连接)
Stop caching for PHP 5.5.3 in MAMP(在 MAMP 中停止缓存 PHP 5.5.3)
Caching HTTP responses when they are dynamically created by PHP(缓存由 PHP 动态创建的 HTTP 响应)
Memcached vs APC which one should I choose?(Memcached 与 APC 我应该选择哪一个?)
What is causing quot;Unable to allocate memory for poolquot; in PHP?(是什么导致“无法为池分配内存?在 PHP 中?)