---

How Magento configuration merges work

A few days ago I wrote a blog post on how configuration works in Magento. While it was fairly comprehensive it missed out on one very important piece of information; how the configuration file merges. It is this merging that gives Magento the power it does for being extensible and so configurable. All over the place you will see code like

Mage::getStoreConfig(‘node/somechild’);

You will see this or something similar EVERYWHERE. The reason why this is powerful is because it allows for multiple different configuration files to be loaded all at once, merged into one giant configuration array and then access any node defined in any file from any place in your application. And, perhaps, once you see now it works any mysticism you may have towards Magento configuration may be slightly de-mysticism-fied.