Magento 中仍然使用数据库布局更新吗?
在 Magento 布局系统的深处,有以下代码用于将包布局 xml 文件转换为创建块所需的特定 XML,从而创建页面
public function merge($handle)
{
$packageUpdatesStatus = $this->fetchPackageLayoutUpdates($handle);
if (Mage::app()->isInstalled()) {
$this->fetchDbLayoutUpdates($handle);
}
}
第二种方法 fetchDbLayoutUpdates
尝试加载使用 SQL 查询从数据库进行额外的 XML 更新,如下所示
SELECT `update`.`xml` FROM `core_layout_update` AS `update`
INNER JOIN `core_layout_link` AS `link`
ON link.layout_update_id=update.layout_update_id
WHERE (link.store_id IN (0, '1'))
AND (link.area='frontend')
AND (link.package='default')
AND (link.theme='default')
AND (update.handle = 'default')
ORDER BY `update`.`sort_order` ASC'
在默认安装中,core_layout_update
和 core_layout_link
表都是空的。
所以,我一直认为这是我使用 Magento 之前的遗留功能。 是否在任何地方使用此功能
- 有谁知道
Magento核心代码库
任何众所周知/著名的扩展
你!< /p>
我可以理解为什么该功能被保留下来(遗留问题以及其他问题),但我很好奇它是否已被正式放弃,或者是否只是大大未得到充分利用。
Deep in the Magento Layout system, there's the following code that's used to turn your package layout xml files into the specific XML needed to create your Blocks, and therefore create your pages
public function merge($handle)
{
$packageUpdatesStatus = $this->fetchPackageLayoutUpdates($handle);
if (Mage::app()->isInstalled()) {
$this->fetchDbLayoutUpdates($handle);
}
}
The second method there fetchDbLayoutUpdates
tries to load additional XML Updates from the database with SQL queries something like this
SELECT `update`.`xml` FROM `core_layout_update` AS `update`
INNER JOIN `core_layout_link` AS `link`
ON link.layout_update_id=update.layout_update_id
WHERE (link.store_id IN (0, '1'))
AND (link.area='frontend')
AND (link.package='default')
AND (link.theme='default')
AND (update.handle = 'default')
ORDER BY `update`.`sort_order` ASC'
Both the core_layout_update
and core_layout_link
tables are empty in a default installation.
So, I've always assumed this is a legacy feature that predates my time with Magento. Does anyone know if this feature is used anywhere by
The Magento Core Codebase
Any well known/prominent Extensions
You!
I can see why the feature's been left in place (legacy concerns and what not), but I'm curious if it's something that's been officially-ish abandoned, or if it's just vastly under utilized.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一些添加
enterprise_banner
块的cms_index_index
条目。所以至少企业版使用它。I have some entries for
cms_index_index
that adds anenterprise_banner
block. So it is used by Enterprise edition at least.core_layout_update 与小部件实例相关,似乎 core_layout_update 对于从 CMS->Widgets 添加的每个小部件实例都有行
core_layout_update is related with widget instance, it seem core_layout_update has row for every widget instance that added from CMS->Widgets