3

In magento all config.xml files from all modules are merged to a single file at the end.

Is it possible to show the content of that file for debugging purposes?

2 Answers 2

3

you can try to print the result of Mage::getConfig()->getNode()->asXML()

2

I found the solution. I installed n98-magerun

Execute this command:

./n98-magerun.phar config:dump

Please prefer the above method, because it is the safest one. There is a risk that your frontend users can see your output if you are using other methods which are rendering the output in the frontend.

Alternative Method - if you like to only view specific config files e.g. system.xml (or of course config.xml):

header('Content-Type: text/plain');            
echo Mage::getConfig()
->loadModulesConfiguration('system.xml')        
->getNode()
->asXML();            
exit;

Found here.

The loadModulesConfiguration method will look in each configured module’s etc folder for a file with the passed in name (in this case, system.xml). Magento has a number of other configuration files (api.xml, wsdl.xml, wsdl2.xml, convert.xml, compilation.xml, install.xml), and as a module developer you can leverage this functionality to create your own.

1
  • Is there a similar function in M2 equivalent to this one to get webapi collection as xml? I see way to get di dependency dump but not webapi
    – Elamurugan
    Commented Apr 19, 2020 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.