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/