Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inspect config XML tree magento generates

Tags:

magento

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?

like image 582
user1572427 Avatar asked Aug 02 '12 19:08

user1572427


2 Answers

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.

like image 168
Drew Hunter Avatar answered Oct 29 '22 03:10

Drew Hunter


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

like image 40
siliconrockstar Avatar answered Oct 29 '22 03:10

siliconrockstar