How Magento load all modules

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


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;
     }

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()
     {
         Varien_Profiler::start('config/load-modules');
         $this->_loadDeclaredModules();

         $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) {
             $this->extend($mergeConfig);
         }

         $this->applyExtends();
         Varien_Profiler::stop('config/load-modules');
         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)) {

continue;

}

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.

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 Conferencing and social media domain. The motive of creating cutehits was just to share the knowledge/solutions I get to know during my day to day life so that if possible I can help someone for same problems/solutions. CuteHits.com is a really a very effort for sharing knowledge to rest of the world. For any query/suggestion about same you can contact me on below details:- Email: shekharmca2005 at gmail.com Phone: +91-9560201363

Latest posts by Chandra Shekhar (see all)

You may also like...