View Magento’s sorted module tree

Here is an easy way to view Magento’s module tree after dependency sorting has been applied.

# File: app/code/core/Mage/Core/Model/Config.php  
# Method: _loadDeclaredModules()  
# Line: around 830  
        foreach ($moduleDepends as $moduleProp) {  
            $node = $unsortedConfig->getNode('modules/'.$moduleProp['module']);  
            $sortedConfig->getNode('modules')->appendChild($node);  
        }  
// Add these lines to output the sorted config as an array  
$modules = array_keys((array)$sortedConfig->getNode('modules')->children());  
print_r($modules);  
die;  
        $this->extend($sortedConfig);