来自 Mage/Core/Model/Config 单例对象的 _xml 保护变量是否包含来自模块的所有配置信息?

Is the _xml protected variable from Mage/Core/Model/Config singleton object that holds all config information from modules ?

我正在学习认证,我得出了这个结论。 magento 从 app/etc/modules/*.xml 加载所有可用模块后,它从每个模块加载所有配置文件,并将其存储在 _xml 属性 from Mage/Core/Model/Config单身人士。 我说的对吗?

是的,你是对的。

The Mage_Core_Model_Config object has an _xml property. This property will store a PHP SimpleXML object which represents the tree for the Magento global config. However, this SimpleXML object is instantiated with a custom PHP class. This class is Mage_Core_Model_Config_Element, which extends a Varien_Simplexml_Element, which extends the built in SimpleXMLElement.

来源:The Magento Global Config, Revisited

您可以像这样将配置转储到文件中:

<?php

include_once 'app/Mage.php';
Mage::app();

$config = Mage::app()->getConfig()->getNode();
$io = new Varien_Io_File();
$io->write('magento_config.txt', $config->asNiceXml());