I’d like to have a debug flag in the Magento extension that I’m developing. I’d like to have it set to true when I develop and when I release the extension to users have it removed (defaulting to false). What is the best way to implement this?
The first thing that comes to mind is to have this flag default to false and set it to true in my app/etc/local.xml file. But how can I introduce a new XML node into local.xml and have the Magento infrastructure parse if for me and make it available to my PHP code? Are there other, easier approaches to this?
Magento ECG gave me a good solution in the Magento forums: http://www.magentocommerce.com/boards/viewthread/226496/
Quoting them:
And what I’m going to do is put the same XML block in my local.xml file. That way it only kicks in on my development machine and does not get published with my Magento extension (as does the extension’s own config.xml)