Magento Forum

   
Infinite loop in config.php
 
czyc
Jr. Member
 
Total Posts:  5
Joined:  2008-05-08
 

After upgrading to 19870, the script execution kept timing out in config.php.  Turns out I have a local module alphabetically lower then Mage_All.xml causing the module sort in _loadDeclaredModules to fail.

At line 235:

// prepare unsorted modules with links
        foreach ($unsortedConfig->getNode('modules')->children() as $moduleName=>$moduleConfig{
            
if (!isset($unsortedModules[$moduleName])) $unsortedModules[$moduleName] = array();
            if (
$moduleConfig->depends{
                
foreach ($moduleConfig->depends->children() as $dependName=>$depend{
                    $unsortedModules[$moduleName][
'parents'][$dependName] true;
                    if (!isset(
$unsortedModules[$dependName])) $unsortedModules[$dependName] = array();
                    
$unsortedModules[$dependName]['children'][$moduleName] true;
                
}
            }
        }
fixes it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

You could also add dependency on Mage_Page module, so your module will load after:

<config>
   <
modules>
     <
Your_Module>
        <
depends>
            <
Mage_Page/>
        </
depends>
     </
Your_Module>
    </
modules>
...

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

I see what you mean, will incorporate it in core smile

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Demin Yin
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-06-01
Las Vegas
 

Very nice catch!.

I’m working on a new module used by myself only, and named the module as ‘Deminy_AppStatus’, whose module configuration file (Deminy_AppStatus.xml) apparently would be loaded earlier than almost any other module configuration files.

I was trying to figure out why the CPU usage was about 100% after I have the module installed, until I saw this post.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top