The configuration is made up of multiple xml files. The locations for these files are

  • app/etc/local.xml
  • app/code/{codepool}/{namespace}/{module}/etc/*.xml
  • app/etc/modules/*.xml

The index.php files call Mage::run(). This instantiates the Mage_Core_Model_App class which the instantiates the config model Mage_Core_Model_Config. This files extends Mage_Core_Model_Config_Base which then extends Varien_Simplexml_Config.

The init function of the config class called

public function init($options=array())
{
$this->setCacheChecksum(null);
$this->_cacheLoadedSections = array();
$this->setOptions($options);
$this->loadBase();

$cacheLoad = $this->loadModulesCache();
if ($cacheLoad) {
return $this;
}
$this->loadModules();
$this->loadDb();
$this->saveCache();
return $this;
}

 

The important methods to look at here are loadBase, loadModules, loadDb. These methods build up and merge the config into one Simplexml object.

loadBase()

The loads the global configuration files app/etc/local.xml and app/etc/config.xml.

loadModules()

This will first get a list of all modules using the $this->_loadDeclaredModules() method. It will then loop through every modules merging the config into the simplexml object.

loadDb()

This then combines the configuration from the database.