How Magento load all modules

app\code\core\Mage\Core\Model\config.php you can see init function

public function init($options=array())
         $this->_cacheLoadedSections = array();

         $cacheLoad = $this->loadModulesCache();
         if ($cacheLoad) {
             return $this;
         return $this;

You can see loadModules() function of same file to see which all modules gets loaded on this page.This  function call _loadDeclaredModules () .

public function loadModules()

         $resourceConfig = sprintf('config.%s.xml', $this->_getResourceConnectionModel('core'));
         $this->loadModulesConfiguration(array('config.xml',$resourceConfig), $this);

          * Prevent local.xml directives overwriting
         $mergeConfig = clone $this->_prototype;
         $this->_isLocalConfigLoaded = $mergeConfig->loadFile($this->getOptions()->getEtcDir().DS.'local.xml');
         if ($this->_isLocalConfigLoaded) {

         return $this;

Under _loadDeclaredModules function you can see how many modules are get loaded and how it parse their config files and dependency etc.

How does layout update takes place on magento:

Layout update of custom modules take place throgh below ways


#File: app/code/core/Mage/Core/Model/Layout/Update.php

public function getFileLayoutUpdatesXml(


foreach ($updateFiles as $file) {

$filename = $design->getLayoutFilename($file, array(

'_area'    => $area,

'_package' => $package,

'_theme'   => $theme


if (!is_readable($filename)) {



You can see

echo “Area=>”.$area.” & package=”.$package.”&theme=”.$theme;

if you see your layout file is available or not because might be your layout  file is not available at actual  location like required them and package.

Related posts:

The following two tabs change content below.

Chandra Shekhar

GCP Architect
Chandra Shekhar Pandey is Google certified Cloud engineer, I am Magento2 Trained developer. Having huge experience in designing cloud solution. I have around 12 years of experience with world enterprise IT companies and fortune 500 clients. During my architecture design I am always caring about high availability, fast performance and resilient system. From the programmer background I have huge experience in LAMP stack as well. Throughout my carrier I have worked on Retail, E-Learning, Video... Read More about Chandra Shekhar

Latest posts by Chandra Shekhar (see all)