user1572427
user1572427

Reputation: 259

Inspect config XML tree magento generates

As the title implies, I want to inspect the complete config XML tree generated by Magento.

I have looked at the config object and cannot see a way to do this.

How can this be done?

Upvotes: 5

Views: 2811

Answers (2)

siliconrockstar
siliconrockstar

Reputation: 3664

I figured this would come in handy so I built a tiny Magento module that will show the config if you add ?showConfig=1 to the URL. Props to Drew Hunter for the initial code.

https://github.com/siliconrockstar/showconfig

Upvotes: 1

Drew Hunter
Drew Hunter

Reputation: 10114

To get the config xml in its entirety (as xml which is what I assume you are referring to)...

Mage::app()->getConfig()->getXmlString();

It will be much easier to inspect if you save it to a file. The following will save to a file at var/tmp/configxml.xml...

file_put_contents(Mage::getBaseDir('tmp').DS.'configxml.xml', Mage::app()->getConfig()->getXmlString());

Obviously, Magento has to have been bootstrapped first.

Upvotes: 9

Related Questions