php - magento资源中的version和data_version有什么区别?

标签 php magento

mysql> select * from core_resource;
+-------------------------+------------+--------------+
| code                    | version    | data_version |
+-------------------------+------------+--------------+
| adminnotification_setup | 1.0.0      | 1.0.0        |

我从未发现这两列之间的值有差异,并且我不确定 data_version 的确切用途。

这个东西有用吗?我可以从使用中受益吗?

最佳答案

data_version以及相应的所谓“数据升级脚本”出现在CE1.4中。

数据安装/升级脚本在形式和功能上与“常规”安装和升级脚本相同。它们只是在初始化期间稍后执行,主要环境差异是存在一个存储对象和一个初始化的请求对象,尽管我无法想象在升级工作流程中适当使用后者。

来自Mage_Core_Model_App:

public function run($params)
{
    //snip...
    if ($this->_cache->processRequest()) { //cache hook
        $this->getResponse()->sendResponse();
    } else {
        $this->_initModules(); //triggers "normal" install & upgrade workflow
        //snip...
        if ($this->_config->isLocalConfigLoaded()) {
            //snip...
            $this->_initCurrentStore($scopeCode, $scopeType);
            $this->_initRequest();
            Mage_Core_Model_Resource_Setup::applyAllDataUpdates(); //data upgrade scripts
        }

        $this->getFrontController()->dispatch();
    }
    return $this;
}

关于php - magento资源中的version和data_version有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11122987/

相关文章:

php - 使用 php 从具有多个参数(来自不同列)的 mysql 表中查找行

php - Opencart : How To Load Different CSS Style, 基于语言

php - 使用 file_exists() 检查 WordPress 上传文件夹

php - MySQL - 将 LIKE 运算符与 UNHEX() 函数结合使用

Magento XML - cms_index_index 和 cms_index_defaultindex 的区别

php - 从 Magento 中的脚本保存具有分层定价的产品模型时的奇怪行为

Apache 是 "Unable to initialize module",因为更改 PHP 配置后模块和 PHP 的 API 不匹配

java - 如何从 SOAP api 获取 Magento 产品 URL

magento - 在系统配置magento中获取自定义电子邮件模板?

php - 如何使用product_index改进Magento查询